ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF statement inside a SUMIF statement.... or alternative method (https://www.excelbanter.com/excel-worksheet-functions/250146-if-statement-inside-sumif-statement-alternative-method.html)

Sungibungi

IF statement inside a SUMIF statement.... or alternative method
 
I'm just not sure whether this is possible or not.

Can I create a function that goes as below:

=SUMIF(IF(......),Z,A:A)

It seems when I insert an IF statement inside a SUMIF statement, Excel
returns #VALUE! If this is not allowed, how do I get around this problem?

Eduardo

IF statement inside a SUMIF statement.... or alternative method
 
Hi,
the sumif already has the criteria, what do you want to achieve, please post
an example

"Sungibungi" wrote:

I'm just not sure whether this is possible or not.

Can I create a function that goes as below:

=SUMIF(IF(......),Z,A:A)

It seems when I insert an IF statement inside a SUMIF statement, Excel
returns #VALUE! If this is not allowed, how do I get around this problem?


T. Valko

IF statement inside a SUMIF statement.... or alternative method
 
=SUMIF(IF(......),Z,A:A)

SUMIF can't be used like that.

Try explaining in words what you want to do.

--
Biff
Microsoft Excel MVP


"Sungibungi" wrote in message
...
I'm just not sure whether this is possible or not.

Can I create a function that goes as below:

=SUMIF(IF(......),Z,A:A)

It seems when I insert an IF statement inside a SUMIF statement, Excel
returns #VALUE! If this is not allowed, how do I get around this problem?




Paul C

IF statement inside a SUMIF statement.... or alternative method
 
you may have you criteria in the wrong order

SUMIF(range, criteria, [sum_range]) is the correct format.

Your IF statement would need to evaluate to a range (both when true or
false) to work as you have written your formula. It is possible to have a if
statement return a range (using the offset function would work), but there is
likely an easier way.

You did not provide much detail so I cannot give you a definate answer, but
can offer the following advice.

If you wish to sum something based on multiple criteria (for example sum up
all values in c1:c10 where column A=1 and B="Yes") you could do this in two
ways.

If you have Excel 2007 use the SUMIFS function which allows for multiple
criteria or
use a sumproduct function with conditions.

the formula =Sumproduct(--(A1:a10=1),(b1:b10="Yes"),C1:C10) would work.
--
If this helps, please remember to click yes.


"Sungibungi" wrote:

I'm just not sure whether this is possible or not.

Can I create a function that goes as below:

=SUMIF(IF(......),Z,A:A)

It seems when I insert an IF statement inside a SUMIF statement, Excel
returns #VALUE! If this is not allowed, how do I get around this problem?



All times are GMT +1. The time now is 05:13 PM.

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