Sumif(Text(Range,"mmmm"),"January",Range) does not work

kornsatu

New Member
Joined
Feb 20, 2018
Messages
9
Hi,

I have 2-column data record (hourly data in 1 year = 8760 rows), for example:

Column 1 Column 2
1/1/2018 00:00 15
1/1/2018 01:00 20
1/1/2018 02:00 5
.
.
.
31/12/2018 23:00 20


Then, I would like to summarize to monthly value.
What I use is
=sumif(text(A2:A8761,"mmmm"),"January",B2:B8761)

it seems to be not working, I don't understand why?

However, I can use {=sum(if(text(A2:A8761,"mmmm")="January",B2:B8761))} which is in this case working fine.
But I would like to know why sumif function does not work

Thank you for your help
 
Yes, it returns the range output as text. That's not what SumIf() requires.

SumIf() requires the reference to the range.

Ex.:
A1:C1 have 1,2,3

SumIf(A1:C1,...,...) is OK, the parameter has a reference to the range

SumIf({1,2,3},...,...) does not work. The parameter has the values of the range, not the reference to the range

Very Clear explanation. Now I understood why it does not work.
Thanks a lot
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,216,075
Messages
6,128,657
Members
449,462
Latest member
Chislobog

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