Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
heater
 
Posts: n/a
Default 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   Report Post  
bj
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
heater
 
Posts: n/a
Default

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   Report Post  
heater
 
Posts: n/a
Default

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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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
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
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
IF Statement nightmare eugenevr Excel Discussion (Misc queries) 6 May 18th 05 01:09 PM
What statement to use? Paul Excel Worksheet Functions 6 February 13th 05 05:23 PM
How do I fix a circular reference in a financial statement? drjayhawk25 Excel Discussion (Misc queries) 0 February 7th 05 05:19 PM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM


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