Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
SUM and IF results
I want to SUM a horizontal row of cells, of which one contains the IF function:
=IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0"))) I want the results of the IF function, 50, 25, or 0, to be included in the SUM. Any tips? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
SUM and IF results
Hi
Replace your formula with =IF(C2<2,50,IF(C2=2,25,IF(C23,0))) But what about 3=C22 Btw. you can do without any IF's (slightly different conditions in my example here) =50-(C2=2)-(C22) -- Arvi Laanemets ( My real mail address: arvi.laanemets<attarkon.ee ) "David" wrote in message ... I want to SUM a horizontal row of cells, of which one contains the IF function: =IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0"))) I want the results of the IF function, 50, 25, or 0, to be included in the SUM. Any tips? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
SUM and IF results
=IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0")))
At the very least remove the quotes from around the numbers. Enclosing numbers in quotes makes them TEXT and a SUM function ignores text. =IF(C2<2,50,IF(C2=2,25,IF(C23,0))) Now, about your logic in the formula... If C2 = 3 the result will be FALSE. If C2 is empty the result will be 50. So, I'd write the formula like this: =IF(ISNUMBER(C2),IF(C2<2,50,IF(C2=2,25,0)),0) Now you can include that cell in your SUM function. Biff "David" wrote in message ... I want to SUM a horizontal row of cells, of which one contains the IF function: =IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0"))) I want the results of the IF function, 50, 25, or 0, to be included in the SUM. Any tips? |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
SUM and IF results
=50-(C2=2)-(C22)
Think you're missing some stuff the =50-(C2=2)*25-(C22)*50 And to account for an empty cell: =(50-(C2=2)*25-(C22)*50)*(C2<"") Biff "Arvi Laanemets" wrote in message ... Hi Replace your formula with =IF(C2<2,50,IF(C2=2,25,IF(C23,0))) But what about 3=C22 Btw. you can do without any IF's (slightly different conditions in my example here) =50-(C2=2)-(C22) -- Arvi Laanemets ( My real mail address: arvi.laanemets<attarkon.ee ) "David" wrote in message ... I want to SUM a horizontal row of cells, of which one contains the IF function: =IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0"))) I want the results of the IF function, 50, 25, or 0, to be included in the SUM. Any tips? |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
SUM and IF results
Arvi!
Thanks, I love the simple solutions. David "Arvi Laanemets" wrote: Hi Replace your formula with =IF(C2<2,50,IF(C2=2,25,IF(C23,0))) But what about 3=C22 Btw. you can do without any IF's (slightly different conditions in my example here) =50-(C2=2)-(C22) -- Arvi Laanemets ( My real mail address: arvi.laanemets<attarkon.ee ) "David" wrote in message ... I want to SUM a horizontal row of cells, of which one contains the IF function: =IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0"))) I want the results of the IF function, 50, 25, or 0, to be included in the SUM. Any tips? |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
SUM and IF results
T!
Thanks, I love the simple answers. David "T. Valko" wrote: =IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0"))) At the very least remove the quotes from around the numbers. Enclosing numbers in quotes makes them TEXT and a SUM function ignores text. =IF(C2<2,50,IF(C2=2,25,IF(C23,0))) Now, about your logic in the formula... If C2 = 3 the result will be FALSE. If C2 is empty the result will be 50. So, I'd write the formula like this: =IF(ISNUMBER(C2),IF(C2<2,50,IF(C2=2,25,0)),0) Now you can include that cell in your SUM function. Biff "David" wrote in message ... I want to SUM a horizontal row of cells, of which one contains the IF function: =IF(C2<2,"50",IF(C2=2,"25",IF(C23,"0"))) I want the results of the IF function, 50, 25, or 0, to be included in the SUM. Any tips? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why Different results | Excel Discussion (Misc queries) | |||
different results | Excel Discussion (Misc queries) | |||
Sum of If Results. How? | Excel Worksheet Functions | |||
Conditional Sum Argument results do not equal cell results Excel | Excel Worksheet Functions | |||
min or max results | Excel Worksheet Functions |