SUMIF Help

ddub25

Well-known Member
Joined
Jan 11, 2007
Messages
625
Office Version
  1. 2019
Platform
  1. Windows
Struggling to create the correct syntax for a SUMIF. I want to ask:

IF Y3="Dan W"
THEN, SUMIF('Profit Breakdown'!A5:A26,THIS MONTH,'Profit Breakdown'!C5:C26)

IF Y3="Paul P"
THEN, SUMIF('Profit Breakdown'!M5:M26,THIS MONTH,'Profit Breakdown'!O5:O26)

IF NOT=0

Can anyone help, thanks

Dan
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Is "THIS MONTH" a named formula? If so, there should not be a space.
What is the result/error that you are getting?
 
Upvote 0
I've developed the formula a bit further and arrived at the formula below so far.

=IF(R3="Dan W",SUMIFS('Profit Breakdown'!B5:B26,'Profit Breakdown'!A5:A26,"10/8/2011"),IF(R3="Paul P",SUMIFS('Profit Breakdown'!N5:N26,'Profit Breakdown'!M5:M26,"10/8/2011"),0))

The bit that I am struggling with is the ["10/8/2011"] part. The range A5:A26 contains the months of 2011 in mmm-yy format. Instead of having "10/8/2011", I want to replace this
part with a formula that looks for the row that contains this month in A5:A26 and returns the corresponding value in B5:B26.

["THIS MONTH" was not a named formula, just text trying to explain what I was after. Hope it's explained better above.] Thanks.

Dan
 
Upvote 0
Excel Workbook
DEFG
13DanMonth Selection
1416/08/2011
1520/06/201127828197632
1625/07/2011341283
1707/11/2011285346
1826/10/2011257360
1910/09/2011268296
2011/08/2011339288
2131/10/2011309293
2201/10/2011353304
2306/12/2011282354
2401/10/2011291282
Sheet4


not entirley sure of your query, but this should adapt
 
Upvote 0
Thanks, I've adapted your formula to this:

=IF(R3="Dan W",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!A5:A26)),'Profit Breakdown'!B5:B26),"")

How would I also be able to include another IF in the formula? I'd like to also lump this formula:

=IF(R3="Paul P",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!M5:M26)),'Profit Breakdown'!N5:N26),"")

with the original:

=IF(R3="Dan W",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!A5:A26)),'Profit Breakdown'!B5:B26),"")

Thanks.

Dan
 
Upvote 0
Hi:)

Try this simple illustration. Is this related to your problem? Kinda a different presentation but I dont know if thats what you want.

By changing the value in R2 you get result to the other table for Dan W or Paul P.
Excel Workbook
ABMNRSTUV
1DateAmountDateAmountPersonDateCriteriaDan WPaul P
2Aug-11100Aug-11300Paul P10/08/20113350
3Aug-11200Aug-11350
4Aug-11300Aug-11400
5Aug-11400Aug-11450
6Sep-11500Sep-11500
7Aug-11600Aug-11550
8Aug-11700Aug-11600
9Oct-11800Oct-11650
10Aug-11900Aug-11700
Sheet3
Excel 2010
Cell Formulas
RangeFormula
U2=IF(R2=U1,SUMIF(A2:A10,T2,B2:B10),"")
V2=IF(R2=V1,SUMIF(M2:M10,T2,N2:N10),"")
 
Last edited:
Upvote 0
I just want to join the two formulas below together to make one formula. How would I do that?

=IF(R3="Dan W",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!A5:A26)),'Profit Breakdown'!B5:B26),"")

=IF(R3="Paul P",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!M5:M26)),'Profit Breakdown'!N5:N26),"")

Dan
 
Upvote 0
How about this.
Excel Workbook
ABMNRSTU
1DateAmountDateAmountDateCriteriaPersonAmount
2Aug-11100Aug-1130010/08/2011Paul P3350
3Aug-11200Aug-11350
4Aug-11300Aug-11400
5Aug-11400Aug-11450
6Sep-11500Sep-11500
7Aug-11600Aug-11550
8Aug-11700Aug-11600
9Oct-11800Oct-11650
10Aug-11900Aug-11700
Sheet3
Excel 2010
Cell Formulas
RangeFormula
U2=IF(T2="Dan W",SUMIF(A2:A10,S2,B2:B10),IF(T2="Paul P",SUMIF(M2:M10,S2,N2:N10),0))
 
Upvote 0
I just want to join the two formulas below together to make one formula. How would I do that?

=IF(R3="Dan W",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!A5:A26)),'Profit Breakdown'!B5:B26),"")

=IF(R3="Paul P",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!M5:M26)),'Profit Breakdown'!N5:N26),"")

Dan
At the end of the firs formula, instead of the double "" put the entire second formula, which means if the first name isnt found then the search wilk take place on the second. Put the entire second formula but dont inckude the aditional =

Cant to an example proper now as i'm using my phone
 
Upvote 0
Scotty:
=IF(R3="Dan W",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!A5:A26)),'Profit Breakdown'!B5:B26),IF(R3="Paul P",SUMPRODUCT(--(MONTH(Y1)=MONTH('Profit Breakdown'!M5:M26)),'Profit Breakdown'!N5:N26),""))

Villareal:
=IF(R3="Dan W",SUMIF('Profit Breakdown'!A5:A26,Y1,'Profit Breakdown'!B5:B26),IF(R3="Paul P",SUMIF('Profit Breakdown'!M5:M26,Y1,'Profit Breakdown'!N5:N26),0))

Thanks Scotty and Villareal, I've managed to get both of yours adapted and working (as above), but having a problem with my date formats. Both Y1 and the Range A5:A26 are in "mmm-yy"
format, but even though the dates in the range display as:

Sep-10
Oct-10
Nov-10
Dec-10
Jan-11
...
Aug-11 etc...

the actual date displayed in the formula bar is:

10/09/2010
10/10/2010
10/11/2010
10/12/2010
...
10/08/2011 etc...

If i put the date in Y1 as 23/11/11 (a date which does not exist in A5:A26 as we havent reached that month yet and therefore does not have a corresponding value in B5:B26) it returns the value
for Nov-10. It should return 0 for Nov-11 as it is empty.

Any ideas why this is? Do I need to simplify the date format to just Months/Years?

Dan
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top