#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default SumIf Question

I have a spreadsheet that I need to do a calculation if the answer is yes or
"Y". I put the formula below in and it works correctly for the "N" formula.
If the answer is "Y" the formula does not give me the sum of F1+G1 (actually
"-" but I put the number in as a negative) but the total of F1 instead.

=SUMIF(H1,"Y",F1:G1)+SUMIF(H1,"N",F1)


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default SumIf Question

=sumif()
is usually used to compare a range of values against another value. Then add
the values in the other range.

If you're really only checking H1, maybe just changing your formula would be
easiest:

=if(h1="y",sum(f1:g1),0) + if(h1="n",f1,0)



Ronda wrote:

I have a spreadsheet that I need to do a calculation if the answer is yes or
"Y". I put the formula below in and it works correctly for the "N" formula.
If the answer is "Y" the formula does not give me the sum of F1+G1 (actually
"-" but I put the number in as a negative) but the total of F1 instead.

=SUMIF(H1,"Y",F1:G1)+SUMIF(H1,"N",F1)


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default SumIf Question

Try

=IF(H1="y",SUM(F1:G1),IF(H1="n",G1,""))

Mike

"Ronda" wrote:

I have a spreadsheet that I need to do a calculation if the answer is yes or
"Y". I put the formula below in and it works correctly for the "N" formula.
If the answer is "Y" the formula does not give me the sum of F1+G1 (actually
"-" but I put the number in as a negative) but the total of F1 instead.

=SUMIF(H1,"Y",F1:G1)+SUMIF(H1,"N",F1)


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
Help Please SUMIF question baz Excel Discussion (Misc queries) 1 February 14th 08 11:39 PM
SUMIF question Billy B Excel Worksheet Functions 4 January 30th 08 10:44 PM
SUMIF Question Owen888 Excel Worksheet Functions 4 September 28th 06 07:14 PM
SUMIF Question Barb Reinhardt Excel Worksheet Functions 11 May 3rd 06 12:37 AM
Sumif question J Shrimps, Jr. Excel Worksheet Functions 5 January 20th 06 05:26 PM


All times are GMT +1. The time now is 10:26 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"