Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default conditions in Excel

Hi,
I need help with conditions:

How do I write the content of cell B9:
1)A20 AND B20
if true: B9 = c
if False: B9 = d

2) A20 or B20
if true: B9 = e
if False: B9 = f

3) A2 = g AND B2 = h AND C2 = i
if true: B9 = j
if False: B9 = k

4) A2 = l OR B2 = m OR C2 = n
if true: B9 = o
if False: B9 = p

Any answer willbe appriceated
Peter
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default conditions in Excel

Hi
some questions:
- do you want a worksheet formula or a VBA solution?
- your first and second condition are identical but you want different
results?

--
Regards
Frank Kabel
Frankfurt, Germany


farsta_online wrote:
Hi,
I need help with conditions:

How do I write the content of cell B9:
1)A20 AND B20
if true: B9 = c
if False: B9 = d

2) A20 or B20
if true: B9 = e
if False: B9 = f

3) A2 = g AND B2 = h AND C2 = i
if true: B9 = j
if False: B9 = k

4) A2 = l OR B2 = m OR C2 = n
if true: B9 = o
if False: B9 = p

Any answer willbe appriceated
Peter


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default conditions in Excel

Hi Frank and thanks for your answer
If it not too mutch trubble I would like to have both a worksheet
formula or a VBA solution?

In your answer you wrote that:"your first and second condition are
identical but you want different
results?" They aren´t identical, in #1 both conditions have to been met
and in #2 either of the conditionx

Regards
Peter




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default conditions in Excel

Hi
sorry for not reading carefully enough (too early in the morning).
Though there's still a problem:
Assume the first condition is not met (e.g. only A20) then you say you
want the 'False' result of 'd'. BUT your second condition in this case
is also met and this would require 'e'. So what is for example your
expected result for:
A2 = 2
B2 = -1



--
Regards
Frank Kabel
Frankfurt, Germany


Peter L wrote:
Hi Frank and thanks for your answer
If it not too mutch trubble I would like to have both a worksheet
formula or a VBA solution?

In your answer you wrote that:"your first and second condition are
identical but you want different
results?" They aren´t identical, in #1 both conditions have to been
met and in #2 either of the conditionx

Regards
Peter




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default conditions in Excel



Oki, I see how you mean. But I´m looking for the principle to write
multiple conditions
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default conditions in Excel

OK, it´s maybee easier if I give a real life example:
D8 = 100 AND 1.5 < D6/D8 < 25
IF True: D8 = 100
else D8 = 250 AND 1.5 < D6/D8 < 25
If True: D8 = 250
else
D8 = 500 AND 1.5 < D6/D8 < 25
If TrueD8 = 500

Do you see what I´m trying to do?
/Peter




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default conditions in Excel

Hi
you could always used nested IF conditions. To give you an example
=IF(AND(A10,B10),"A1+B1 0",IF(OR(A10,B10),"A1 or B1 are 0","None
is greater than zero"))

Note: The maximum are 7 nested function calls


--
Regards
Frank Kabel
Frankfurt, Germany


Peter L wrote:
Oki, I see how you mean. But I´m looking for the principle to write
multiple conditions
/Peter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default conditions in Excel

Peter,
D8 cannot hold a value and also the result of a comparison. It's one or the
other. You logic is not sensible as you wish to change the value that you
are using in the comparison to what it would have to be true anyway.

In terms of multiple condition, something this formula in D9 may be what you
want:
=IF(AND(D6/D81.5,D6/D8<25),D8,FALSE)

NickHK

"Peter L" wrote in message
...
OK, it´s maybee easier if I give a real life example:
D8 = 100 AND 1.5 < D6/D8 < 25
IF True: D8 = 100
else D8 = 250 AND 1.5 < D6/D8 < 25
If True: D8 = 250
else
D8 = 500 AND 1.5 < D6/D8 < 25
If TrueD8 = 500

Do you see what I´m trying to do?
/Peter




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
macro for excel msg pop up when certain conditions are met Jenny Excel Discussion (Misc queries) 4 August 17th 09 09:27 PM
Countif Conditions - Use of conditions that vary by cell value JonTarg Excel Discussion (Misc queries) 1 May 30th 08 01:21 PM
2 Conditions + Sum of a colum matching those conditions Jeffa Excel Worksheet Functions 5 June 8th 07 12:14 AM
shade cells based on conditions - i have more than 3 conditions Mo2 Excel Worksheet Functions 3 March 30th 07 07:19 AM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM


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

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"