ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can function be applied to range in sumif prior to criteria check? (https://www.excelbanter.com/excel-worksheet-functions/172086-can-function-applied-range-sumif-prior-criteria-check.html)

Cheese_whiz

Can function be applied to range in sumif prior to criteria check?
 
Hi all,

I have a range of dates I'm using for the first argument in a sumif
function. I need to convert those dates to a single month number (one for
each date) prior to running the criteria check found in the second argument
of the sumif function.

Is that possible?

tahnks,
CW

David Biddulph[_2_]

Can function be applied to range in sumif prior to criteria check?
 
You may find it easier to use SUMPRODUCT, rather than SUMIF.
--
David Biddulph

"Cheese_whiz" wrote in message
...
Hi all,

I have a range of dates I'm using for the first argument in a sumif
function. I need to convert those dates to a single month number (one for
each date) prior to running the criteria check found in the second
argument
of the sumif function.

Is that possible?

tahnks,
CW




Bob Phillips

Can function be applied to range in sumif prior to criteria check?
 
No, use SUMPRODUCT

=SUMPRODUCT(--(MONTH(date_range)=1),--(date_range<""),amount_range)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Cheese_whiz" wrote in message
...
Hi all,

I have a range of dates I'm using for the first argument in a sumif
function. I need to convert those dates to a single month number (one for
each date) prior to running the criteria check found in the second
argument
of the sumif function.

Is that possible?

tahnks,
CW




Max

Can function be applied to range in sumif prior to criteria check?
 
Think you could try sumproduct to get the result directly

Assuming real dates in A2 down, values to be summed in B2 down
then in say, C2, something like this, either:
=SUMPRODUCT((MONTH(A2:A10)=2)*B2:B10)
or
=SUMPRODUCT((TEXT(A2:A10,"mmmyy")="Feb08")*B2:B10)
the latter sums col B for dates falling within a particular month-yr
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Cheese_whiz" wrote:
I have a range of dates I'm using for the first argument in a sumif
function. I need to convert those dates to a single month number (one for
each date) prior to running the criteria check found in the second argument
of the sumif function.

Is that possible?

tahnks,
CW


Cheese_whiz

Can function be applied to range in sumif prior to criteria ch
 
Thanks for the replies!

I finally got it going by using Bob's code as a starting point.

Thanks again for all the replies,
CW

"Bob Phillips" wrote:

No, use SUMPRODUCT

=SUMPRODUCT(--(MONTH(date_range)=1),--(date_range<""),amount_range)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Cheese_whiz" wrote in message
...
Hi all,

I have a range of dates I'm using for the first argument in a sumif
function. I need to convert those dates to a single month number (one for
each date) prior to running the criteria check found in the second
argument
of the sumif function.

Is that possible?

tahnks,
CW






All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com