#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
timmadge
 
Posts: n/a
Default IF Statement


=IF(AND(D126<$I$1,G126="Bts D",G126="Bts
C",2,G126="Asda",G126="Wmm"),"1","")

How do you have a true and false for each option.

Bts D = 1 False = ""
Bts C = 2 False = ""
Asda = 3 False = ""
Wmm = 4 False = ""


--
timmadge
------------------------------------------------------------------------
timmadge's Profile: http://www.excelforum.com/member.php...o&userid=31266
View this thread: http://www.excelforum.com/showthread...hreadid=509389

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default IF Statement

"timmadge" wrote:
=IF(AND(D126<$I$1,G126="Bts D",G126="Bts
C",2,G126="Asda",G126="Wmm"),"1","")
How do you have a true and false for each option.


To begin with, the above IF() condition is either nonsense or
purposely always false. Since G126 cannot have "Bts D" and
"Bts C" etc at the same time, the AND() function is always false.

I suspect you simply do not know how to write the condition.
You should start with asking for help there. As a wild guess:

=IF(AND(D126<$I$1,OR(G126="Bts D",G126="Bts C")), 2,
IF(AND(D126<$I$1,OR(G126="Asda",G126="Wmm")), 1, ""))

That could be rewritten as:

=IF(D126<$I$1, IF(OR(G126="Bts D",G126="Bts C"), 2,
IF(OR(G126="Asda",G126="Wmm"), 1, "")), "")

But you might have meant something different altogether.

How do you have a true and false for each option.
Bts D = 1 False = ""
Bts C = 2 False = ""
Asda = 3 False = ""
Wmm = 4 False = ""


I have no idea what those equations have to do with the formula.
Perhaps you can explain.

My understanding is that you would like to test the correctness
of your IF() with varying combinations of values for D126, $I$1
and G126. At least, that is what you __should__ be asking ;-).

One way is to recognize that you have 15 conditions to deal
with and to manually change the values of each dependent cell
accordingly and be sure the result is what you expect. The
conditions are all pairs of the following sets:

1. D126 < $I$1; D126 = $I$1; D126 $I$1
2. G126 has "Bts D", "Bts C", "Asda", "Wmm", something else

In other words, you would put values into D126 and $I$1 such
that D126 < $I$1, then put each of the 5 possibilities into G126.
Repeat with values in D126 and $I$1 such that D126 = $I$1;
then repeat with values such that D126 $I$1.

If you are interested in a "truth table" solution, please say so.
That is different problem altogether.

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
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
Long IF Statement rmitchell87 Excel Discussion (Misc queries) 2 October 2nd 05 03:50 AM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
What statement to use? Paul Excel Worksheet Functions 6 February 13th 05 05:23 PM


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