Sumif

PGD15

Board Regular
Joined
Aug 5, 2016
Messages
137
Hi,

Got a problem,

I want to use a SUMiF....

though i want to say if cell G1(tab1) = the cell in ranges A1:a350 (tab2) then sum the four cells to the right of A:A (tab2)
e.g. B1:e1 (if first row, or what ever row where this is true) if this is false = ""
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I think you mean:

=SUMPRODUCT((tab2!A1:A350=tab1!G1)*(tab2!B1:E350))
?
 
Upvote 0
got another question sorry, im trying to sum range D1:D100 (tab2) only if the value in range B1:B100 (tab2) is less than that in G1(tab1) BUT must be in the same year

The values in G1 and D1 are dates and in the same format.

I've tried
=sumif(tab2d1:d100,tab1Test(g1,"YY")<,text(tab2b1:b100,"YY")

but the text bit at the end and <> sign doesn't work with the text value of the date.

I tried with a sumifs too but couldn't figure it out :)
 
Upvote 0
If G1 is a date, and B1:B100 are also dates, you should just be able to use a < criterion since a date includes a year part.
 
Upvote 0
Sorry Probably wasn't clear the reason I cant use the <> criterion is that I only want the values less than the value in G1 provided they are from the same year, as using < g1 sums the value from the previous years too (which I don't want)
 
Last edited by a moderator:
Upvote 0
Simplest way would be to add the first of that year as another criterion:

=sumifS(tab2!d1:d100,tab2!b1:b100,"<"&G1,tab2!b1:b100,">="&date(year(G1),1,1))
 
Upvote 0
Simplest way would be to add the first of that year as another criterion:

=sumifS(tab2!d1:d100,tab2!b1:b100,"<"&G1,tab2!b1:b100,">="&date(year(G1),1,1))

Ah didn't think to use the & ugh so obvious now i see :)
cheers!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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