Home |
Search |
Today's Posts |
#1
|
|||
|
|||
More than one IF Statement
I need a formula that will look at cells k125:k127 and if the cells are "Yes"
then subtract A125 from D23 and so on for K126 and K127. If cells K125:K127 are not "Yes" then subtract A93 from d23. It works if K125 is "Yes", but if K125:k127 are not "Yes" it returns #Value!, when it should subtract A93 from D23. Also, if K125 is "Yes", and k126 is "Yes" it returns a -1, when it should return 0 (d23 will be the same number as K125, k126, and k127, so the number should be 0). There probably is an easier formula - Please help. =IF(K125="Yes",(A125-D23),(A93-D23,IF(K126="Yes",(A126-D23),(A93-D23,IF(K127="Yes",(A127-D23),(A93-D23)))))) |
#2
|
|||
|
|||
do you want to subtract D23 from the others or the others from D23? (your
equation and your write-up disagree) try =D23-IF(K125="Yes",A125,IF(K126="Yes",A126,IF(K127="Yes ",A127,A93))) "heater" wrote: I need a formula that will look at cells k125:k127 and if the cells are "Yes" then subtract A125 from D23 and so on for K126 and K127. If cells K125:K127 are not "Yes" then subtract A93 from d23. It works if K125 is "Yes", but if K125:k127 are not "Yes" it returns #Value!, when it should subtract A93 from D23. Also, if K125 is "Yes", and k126 is "Yes" it returns a -1, when it should return 0 (d23 will be the same number as K125, k126, and k127, so the number should be 0). There probably is an easier formula - Please help. =IF(K125="Yes",(A125-D23),(A93-D23,IF(K126="Yes",(A126-D23),(A93-D23,IF(K127="Yes",(A127-D23),(A93-D23)))))) |
#3
|
|||
|
|||
is that what you want?
=IF(COUNTIF(K125:K127,"Yes")=3,A125-D23,A93-D23) -- HTH RP (remove nothere from the email address if mailing direct) "heater" wrote in message ... I need a formula that will look at cells k125:k127 and if the cells are "Yes" then subtract A125 from D23 and so on for K126 and K127. If cells K125:K127 are not "Yes" then subtract A93 from d23. It works if K125 is "Yes", but if K125:k127 are not "Yes" it returns #Value!, when it should subtract A93 from D23. Also, if K125 is "Yes", and k126 is "Yes" it returns a -1, when it should return 0 (d23 will be the same number as K125, k126, and k127, so the number should be 0). There probably is an easier formula - Please help. =IF(K125="Yes",(A125-D23),(A93-D23,IF(K126="Yes",(A126-D23),(A93-D23,IF(K127 ="Yes",(A127-D23),(A93-D23)))))) |
#4
|
|||
|
|||
Your formula works when k125 is "yes", however, for some reason when k126 is
"yes" the result is 1. If k126 is "yes" then D23 will equal the same number as k126; therefore the result should be 0. The same thing happens when K127 equals "yes", the result is 2. However, d23 equals k127, so it should be 0. "bj" wrote: do you want to subtract D23 from the others or the others from D23? (your equation and your write-up disagree) try =D23-IF(K125="Yes",A125,IF(K126="Yes",A126,IF(K127="Yes ",A127,A93))) "heater" wrote: I need a formula that will look at cells k125:k127 and if the cells are "Yes" then subtract A125 from D23 and so on for K126 and K127. If cells K125:K127 are not "Yes" then subtract A93 from d23. It works if K125 is "Yes", but if K125:k127 are not "Yes" it returns #Value!, when it should subtract A93 from D23. Also, if K125 is "Yes", and k126 is "Yes" it returns a -1, when it should return 0 (d23 will be the same number as K125, k126, and k127, so the number should be 0). There probably is an easier formula - Please help. =IF(K125="Yes",(A125-D23),(A93-D23,IF(K126="Yes",(A126-D23),(A93-D23,IF(K127="Yes",(A127-D23),(A93-D23)))))) |
#5
|
|||
|
|||
Not really. You only reference if k125 is "Yes" then A125-d23. What if K126
and/or k127 is "Yes". I need it to subtract D23 from K126 and D23 from k127 if they are "Yes". "Bob Phillips" wrote: is that what you want? =IF(COUNTIF(K125:K127,"Yes")=3,A125-D23,A93-D23) -- HTH RP (remove nothere from the email address if mailing direct) "heater" wrote in message ... I need a formula that will look at cells k125:k127 and if the cells are "Yes" then subtract A125 from D23 and so on for K126 and K127. If cells K125:K127 are not "Yes" then subtract A93 from d23. It works if K125 is "Yes", but if K125:k127 are not "Yes" it returns #Value!, when it should subtract A93 from D23. Also, if K125 is "Yes", and k126 is "Yes" it returns a -1, when it should return 0 (d23 will be the same number as K125, k126, and k127, so the number should be 0). There probably is an easier formula - Please help. =IF(K125="Yes",(A125-D23),(A93-D23,IF(K126="Yes",(A126-D23),(A93-D23,IF(K127 ="Yes",(A127-D23),(A93-D23)))))) |
#6
|
|||
|
|||
How can you subtract from a string value.
How about some examples for each situation? -- HTH RP (remove nothere from the email address if mailing direct) "heater" wrote in message ... Not really. You only reference if k125 is "Yes" then A125-d23. What if K126 and/or k127 is "Yes". I need it to subtract D23 from K126 and D23 from k127 if they are "Yes". "Bob Phillips" wrote: is that what you want? =IF(COUNTIF(K125:K127,"Yes")=3,A125-D23,A93-D23) -- HTH RP (remove nothere from the email address if mailing direct) "heater" wrote in message ... I need a formula that will look at cells k125:k127 and if the cells are "Yes" then subtract A125 from D23 and so on for K126 and K127. If cells K125:K127 are not "Yes" then subtract A93 from d23. It works if K125 is "Yes", but if K125:k127 are not "Yes" it returns #Value!, when it should subtract A93 from D23. Also, if K125 is "Yes", and k126 is "Yes" it returns a -1, when it should return 0 (d23 will be the same number as K125, k126, and k127, so the number should be 0). There probably is an easier formula - Please help. =IF(K125="Yes",(A125-D23),(A93-D23,IF(K126="Yes",(A126-D23),(A93-D23,IF(K127 ="Yes",(A127-D23),(A93-D23)))))) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Do I need a sumif or sum of a vlookup formula? | Excel Worksheet Functions | |||
IF Statement nightmare | Excel Discussion (Misc queries) | |||
What statement to use? | Excel Worksheet Functions | |||
How do I fix a circular reference in a financial statement? | Excel Discussion (Misc queries) | |||
7+ nested if statement? | Excel Worksheet Functions |