Excel Finding Value Based On Criteria - excel

i have multiple columns in my excel spreadsheet (DOLLAR, Date, Year), i am trying to get the values in column DOLLAR, if the DATE is greater than 01 Jan 2014, and the YEAR is 2014.
I tried sumproduct, countifs, if, match and even combinations of them but i cant seem to get the value of DOLLAR based on the criteria. how would i go about doing this? i am still a bit new to this so i don't quite know all the functions yet.
i have something like this right now, also all the DOLLAR value that meets the criteria will all be summed up.
=IF('CDT DWGS-2014'!F:F=2014,IF('CDT DWGS-2014'!Q:Q>DATEVALUE("01-Jan-2014"),"GET DOLLAR VALUE",0),0)
Thank you

Ok, given your extra comments, I also tried to make it a bit more robust for you, so suppose, in your sheet you had:
A1 = Start Date
B1 = End Date
And in your CDT DWGS-2014 sheet, the Dollar amounts were in column A and the dates were in column B, You could use the following formula:
=SUMIFS('CDT DWGS-2014'!A:A,'CDT DWGS-2014'!B:B,">="&A1,'CDT DWGS-2014'!B:B,"<="&B1)
This could be made simpler, but this should do the trick.
Hope this helps!!

Use this formula. Column A, B and C are for DOLLAR, Date and Year respectively.
=SUMPRODUCT(A2:A11,--(B2:B11>DATE(2014,1,1)),--(C2:C11=2014))

Related

Excel a function as SUMIFS criteria

I have a series of dates and values:
8.12.2018 12
5.2.2019 32
15.7.2019 89
I would like to use something like (SUMIFS(YEAR(A1:A3);2018) but it's not allowed.
I know, I could extract the year in a separate column, but here I want to ask, if it's possible inside the sumifs function?
Although I thought you couldnt, it has proven by #forwardEd, you can alter criteria in such a way to use SUMIFS, however, you could also look into SUMPRODUCT for this exercize:
=SUMPRODUCT(--(YEAR(A1:A3)=2018),B1:B3)
Assuming your dates are valid excel dates and not dates as strings/text then you can use the SUMIFS formula for a year as follows:
=SUMIFS(B1:B3,A1:A3,">="&date(2018,01,01),A1:A3,"<="&date(2018,12,31))
Basically the formula is saying sum all the values in B1:B3 where the date in A1:A3 is greater than or equal to the first day of the year AND less than or equal to the last day of the year. I choose to write the date using the date function as it is easier to recognize than the integer format of the date. If you want to write just the year as a criteria in say cell c2 then replace 2018 in the above formula with c2.
UPDATE
I have not tested it but since the default for a date without time is 00:00:00 it would mean the formula above would cut off December 31 with almost any sort of time associated with it. Therefor the better cut off would be less than January 1st of the following year instead of less than or equal to December 31st. As such you could revise the above formula to:
=SUMIFS(B1:B3,A1:A3,">="&date(2018,01,01),A1:A3,"<"&date(2019,01,01))
or
Where C2 is the year as an integer
=SUMIFS(B1:B3,A1:A3,">="&date(C2,01,01),A1:A3,"<"&date(C2+1,01,01))
Alternative approach (a little bit less elegant solution, but might be more clear to less advanced users):
=SUMIFS(B1:B4,A1:A4,">="&"01/01/2018",A1:A4,"<="&"31/12/2018")

COUNTIFS statement, =COUNTIFS(V60:V91, ">="&0,V60:V91,"<="&30)

I'm attempting a COUNTIFS statement,
=COUNTIFS(V60:V91, ">="&0,V60:V91,"<="&30).
I believe I'm making syntactical error, but I can't finding it. Do you know what I'm doing wrong?
There is nothing wrong with your syntax. You have text-that-look-like-numbers in column V.
Note the right-alignment of the numbers in column V. These are true numbers and are counted by your formula in A1. Note the left-alignment of the text-that-look-like-numbers in column W. They are not counted by the same formula in B1.
Use Data, Text to Columns, Fixed Width, Finish on your column V to turn them into right-aligned true numbers.
Based on the comments in your question, you can try this if you are trying to count dates where the day of the month is Greater than or equal to zero (which would be all days), and the days that are less than or equal to 30...so all days except the 31st. If this is wrong interpretation, let us know. The following formula is based on your dates being stored as numbers and formatted to display as a date and not a date stored as text.
=sumproduct((day(V60:V91)>=1)*(day(V60:V91)<=30))

SUMPRODUCT several ifs

I´ve spent a lot of time with a formula in Excel and I´m still blocked. I hope you can help me.
I have a table in Excel with several values as shown in this
screenshot.
What I´m trying to extract is the number of Fruits sold in a specific month. That is, how many lemons were sold in January 2016, for example. This is the formula I´m using:
=SUMPRODUCT((B3:B38=E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
But the result is #N/A as seen in the screenshot.
What Am I doing wrong? Any help, please?
Thanks a lot in advance!
You can use arrays in excel to get this answer
{SUM(IF(MONTH(F$3&"1")=MONTH($A$3:$A$150),IF($E4=$B$3:$B$150,$C$3:$C$150,0),0))}
You can use this Sumproduct formula which uses array logic:
SUMPRODUCT((MONTH($A$3:$A$38)=MONTH(TEXT(G$2,"MMM")&1))*($C$3:$C$38=$F4)*
($D$3:$D$38))
Sumproduct Demo
Part of your problem is your ranges are not equal in length. B3:B38 has to be the same number of rows as $A$3:$A$150 and C3:C150. When rows are not equal things blow up on you.
=SUMPRODUCT(($B$3:$B$150=$E4)*(MONTH($A$3:$A$150)=12)*(YEAR($A$3:$A$150)=2015);$C$3:$C$150)
if you change your header row to be actual excel date format, and then change the cell display format to just show the month (as suggested by csanjose), then you can adjust your sumproduct formula as follows and copy to all cells in your table.
=SUMPRODUCT(($B$3:$B$38=$E4)*(MONTH($A$3:$A$150)=Month(F$3))*(YEAR($A$3:$A$150)=Year(F$3));$C$3:$C$150)
Fill your month-row with the last day of each month, then apply date format to show only month name.
The formula you should use is, for example, in g8:
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&G$3;$A:$A;">"&F$3)
First column "F" doesn't have a column on the left to compare, so you can put a date in E3 or change a bit the formula (example of F8):
=SUMIFS($C:$C;$B:$B;$E8;$A:$A;"<="&F$3;$A:$A;">2015/12/31")
Take a look at the result
If you don't want to use a pivot table, you can use this formula to get what you need:
=SUMPRODUCT(($B$3:$B$150=$E3)*(MONTH($A$3:$A$150)=1)*(YEAR($A$3:$A$150)=2015)*$C$3:$C$150)
Then drag-fill the cell to copy it to every month column (just make sure you change the month number in the formula (and year if you're doing that too)), and then drag-fill down the columns.
That should work pretty food good :)
Good Luck!

Organise dates in excel into 2 month blocks

I'd like to organize dates in an excel spreadsheet into 2 month blocks. So if a date is in January or February, I'd like a function to return "Jan-Feb". If a date is in March or April, I'd like it to return "Mar-Apr" etc. I'm a complete novice at excel formulae. Any help would be greatly appreciated.
Try first creating an index which lists all the possible month combinations. ie, in cells J1:J12, enter "1" "2"..."12". Then in K1:K12, enter "January-February" "January-February""March-April""March-April"..."November-December".
Then put this formula instead of what you have above:
=index($K$1:$K$12,Match(Month(H3),$J$1:$J$12,0))
This works similar to a vlookup function - if you are more comfortable using vlookup, it would look like this:
=vlookup(month(H3),$K$1:$J$12,2,0)
Basically either function searches column K for the number of the month in H3, and then it provides the text string that you have manually typed in that row in column J.

Reverse Index/Match -or- jumping back 1 cell in Index/Match

This started as a just-for-fun formula in a work spreadsheet, but I couldn't figure it out... Simplified (hopefully), I have a row with months (Jan-Dec) and a row below with dollar values. For this month (May) I am adding a dollar value. The preceding months have dollar values entered in them already. My formula needs to look across the $values row and return the month corresponding to the last cell with an value in it.
Right now Jan-May have $values. I want it to stop at the blank $value for June, back up one cell and return the month-cell = May.
I have been playing with different INDEX/MATCH/LEN but haven't landed on anything yet. The only thing I thought of that would work is nested IF statements moving in reverse (Dec -> Jan) looking for the first cell greater than 0. But I'm using an old version and max out at 7 IFs.
I was looking for something and stumbled on your question. I hope it'll still be somewhat useful!
You probably want:
=INDEX(A1:L1,1,COUNTA(A2:L2))
Where A1:L1 contains your months from January to December and A2:L2 contains the values in dollars. I'm assuming that the values are blank for June through December.

Resources