Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Different results Wanna Learn Excel Discussion (Misc queries) 5 January 25th 07 03:44 PM
different results Dave Excel Discussion (Misc queries) 0 January 23rd 07 12:00 AM
Sum of If Results. How? Corey Excel Worksheet Functions 2 December 14th 06 02:48 AM
Conditional Sum Argument results do not equal cell results Excel Randy R Mullins Excel Worksheet Functions 3 August 9th 06 07:16 PM
min or max results GoofyinNY Excel Worksheet Functions 3 December 23rd 05 03:27 PM


All times are GMT +1. The time now is 11:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"