ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   equaton with #'s Y and N (https://www.excelbanter.com/excel-discussion-misc-queries/13246-equaton-s-y-n.html)

Corey

equaton with #'s Y and N
 
I am adding the sum of c3:c24. Cell C3,C10,C11,C13,C14,C17-
C21 will contain the text "Y" or "N" and will have a +5
or -5 value. How do I create a formula to that will run
this equation? Also, I want to be able to set a variable +
and - on different cells. Ex.(C3 if "Y"+3,C3 if "Y"-5)

=IF(C3="Y",SUM(C4:C24)+5,IF(C3="N",SUM(C4:C24)-5)) is
working but only is looking at C3 how do I continue the
equation?

Jason Morin

One way:

=SUM(C3:C24,COUNTIF(C3:C24,{"Y","N"})*{5,-5})

HTH
Jason
Atlanta, GA

-----Original Message-----
I am adding the sum of c3:c24. Cell

C3,C10,C11,C13,C14,C17-
C21 will contain the text "Y" or "N" and will have a +5
or -5 value. How do I create a formula to that will run
this equation? Also, I want to be able to set a variable

+
and - on different cells. Ex.(C3 if "Y"+3,C3 if "Y"-5)

=IF(C3="Y",SUM(C4:C24)+5,IF(C3="N",SUM(C4:C24)-5)) is
working but only is looking at C3 how do I continue the
equation?
.



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

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