Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default IF...AND...OR...Statement

I have the following formula, which does not work
=IF(OR(P28="Yes"),AND(W28=V28,D28-V28),OR(W28<V28,D28-W28,IF(P28="no",0))).
What I need is as follows:

If P28 is "Yes" and IF W28 is equal to V28, then D28 Minus V28, OR If P28 is
"Yes" and W28 is less than V28, then D28 Minus W28, If P28 is "No", then 0.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default IF...AND...OR...Statement

Try this:

=IF(P28="no",0,IF(AND(P28="yes",W28=V28),D28-V28,IF(AND(P28="yes",W28<V28),D28-W28,0)))

--
Biff
Microsoft Excel MVP


"heater" wrote in message
...
I have the following formula, which does not work
=IF(OR(P28="Yes"),AND(W28=V28,D28-V28),OR(W28<V28,D28-W28,IF(P28="no",0))).
What I need is as follows:

If P28 is "Yes" and IF W28 is equal to V28, then D28 Minus V28, OR If P28
is
"Yes" and W28 is less than V28, then D28 Minus W28, If P28 is "No", then
0.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default IF...AND...OR...Statement

On Jan 10, 10:12*am, heater wrote:
I have the following formula, which does not work
=IF(OR(P28="Yes"),AND(W28=V28,D28-V28),OR(W28<V28,D28-W28,IF(P28="no",0))). *
What I need is as follows:

If P28 is "Yes" and IF W28 is equal to V28, then D28 Minus V28, OR If P28 is
"Yes" and W28 is less than V28, then D28 Minus W28, If P28 is "No", then 0..


You could just formulate it exactly as you wrote it, namely:

=if(and(P28="yes",W28=V28), D28-V28, if(and(P28="yes",W28<V28), D28-
W28, 0))

Note: That returns zero even P28="yes", but W28V28, as well as when
P28 is "no". You neglected to cover that condition. So it is unclear
exactly what you want.
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default IF...AND...OR...Statement

On Thu, 10 Jan 2008 10:12:02 -0800, heater
wrote:

I have the following formula, which does not work
=IF(OR(P28="Yes"),AND(W28=V28,D28-V28),OR(W28<V28,D28-W28,IF(P28="no",0))).
What I need is as follows:

If P28 is "Yes" and IF W28 is equal to V28, then D28 Minus V28, OR If P28 is
"Yes" and W28 is less than V28, then D28 Minus W28, If P28 is "No", then 0.



In your explanation in the 2nd paragraph, your "OR" does not make sense to me.
Perhaps you really mean "ELSE" ??

If so, then I believe this will do what you describe:

=IF(AND(P28="Yes",W28=V28),D28-V28,
IF(AND(P28="Yes",W28<V28),D28-W28,
IF(P28="No",0)))

You realize, of course, there are logically possible conditions which are
unspecified. They will return FALSE.
--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,091
Default IF...AND...OR...Statement

IF(P28="Yes",IF(W28<=V28,D28-V28,?),IF(P28="No",0,??))

You will have to fill in the ?'s. What do you want if W28 is greater than
V28 (?). What do you want if P28 is neither "Yes" or "No" (??)

Tyro

"heater" wrote in message news:513F2F6B
...
I have the following formula, which does not work
=IF(OR(P28="Yes"),AND(W28=V28,D28-V28),OR(W28<V28,D28-W28,IF(P28="no",0))).
What I need is as follows:

If P28 is "Yes" and IF W28 is equal to V28, then D28 Minus V28, OR If P28
is
"Yes" and W28 is less than V28, then D28 Minus W28, If P28 is "No", then
0.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,091
Default IF...AND...OR...Statement

Sorry, misread. Use this

=IF(P28="Yes",IF(W28=V28,D28-V28,IF(W28<V28,D28-W28,?),IF(P28="No",0,??))

You will have to fill in the ?'s. What do you want if W28 is greater than
V28 (?). What do you want if P28 is neither "Yes" nor "No" (??)

tyro

"Tyro" wrote in message
et...
IF(P28="Yes",IF(W28<=V28,D28-V28,?),IF(P28="No",0,??))

You will have to fill in the ?'s. What do you want if W28 is greater than
V28 (?). What do you want if P28 is neither "Yes" or "No" (??)

Tyro

"heater" wrote in message news:513F2F6B
...
I have the following formula, which does not work
=IF(OR(P28="Yes"),AND(W28=V28,D28-V28),OR(W28<V28,D28-W28,IF(P28="no",0))).
What I need is as follows:

If P28 is "Yes" and IF W28 is equal to V28, then D28 Minus V28, OR If P28
is
"Yes" and W28 is less than V28, then D28 Minus W28, If P28 is "No", then
0.





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
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
If Statement heater Excel Discussion (Misc queries) 2 August 15th 05 10:48 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 02:10 PM.

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

About Us

"It's about Microsoft Excel"