Combining the "AND", "IF" and the "OR" functions into the one equation???
Hello All,
My Windows XP Laptop runs the ol'e 2003 version of Excel.
Can some kind genius please help me with combining the "IF", "AND" and "OR" functions. (unless there is an easier way).
I have tried numerous ways via Trial and E-R-R-O-R and there seems to be nothing over the internet on combining all 3 functions.
(most likely I have been going about it all wrong, obviously, which is why I haven't included any of my current workings)
So here are my 8 queries, put into plain language. (negative numbers are never considered, included or factored into any equation / scenario throughout).
Row 1|Column J (Cell J1):
Part 1:
IF L1 is less than 11 (eleven)
AND K1 is less than 1.40
THEN J1 reads "LHF10" and the cell coloured Light Green
(other wise this cell is left blank.)
BUT
Part 2:
IF L1 is less than 11 (eleven)
AND K1 is greater than 1.90 (BUT less than 3.00)
THEN J1 reads "LHD10" and the cell coloured Tan
(other wise this cell is left blank.)
___________________________________________________
Row 1|Column I (Cell I1):
Part 1:
IF L1 is less than 11 (eleven)
AND K1 is greater than 1.39 (BUT less than 1.90)
THEN I1 reads "HHF10" and the cell coloured Bright Green
(other wise this cell is left blank.)
BUT
Part 2:
IF L1 is less than 11 (eleven)
AND K1 is greater than 2.99
THEN I1 reads "HHD10" and the cell coloured Gold
(other wise this cell is left blank.)
___________________________________________________
Row 1|Coulmn H (Cell H1):
Part 1:
IF L1 is 11 (eleven) or greater
AND K1 is less than 1.40
THEN H1 reads "LHF11" and the cell coloured Aqua
(other wise this cell is left blank.)
BUT
Part 2:
IF L1 is 11 (eleven) or greater
AND K1 is greater than 1.90 (BUT less than 3.00)
THEN H1 reads "LHD11" and the cell coloured Light Orange
(other wise this cell is left blank.)
___________________________________________________
Row 1|Column G (Cell G1):
Part 1:
IF L1 is 11 (eleven) or greater
AND K1 is greater than 1.39 (BUT less than 1.90)
THEN G1 reads "HHF11" and the cell coloured Light Blue
(other wise this cell is left blank.)
BUT
Part 2:
IF L1 is 11 (eleven) or greater
AND K1 is greater than 2.99
THEN G1 reads "HHD11" and the cell coloured Orange
(other wise this cell is left blank.)
___________________________________________________
ALSO:
Obviously all of this, displays only on the first row, utilising columns (cells) G, H, I and J (equating from columns K and L),
and needs to be transferable (dragged down / copied) to suit more rows as required.
AND:
If you hadn't already worked out, there would obviously need to be another 8 equations, utilising columns O, P, Q and R (equating from columns M and N),
but I do believe that I can do that myself, once I get my head round these equations / solutions, albeit given they will_ have slightly different ranges to calculate / consider.
(ughh! - can it even be done in Excel 2003? Surely it can? but i'm guessing I might need Excel 2010? - is Excel 2010 even compatible with Windows XP?)
NB: after about the 5th consideration, my brain literally went from the tingle phase, straight to the W.O.W.S phase. (ie: Leonardo Dicaprio in his "Quaalude meltdown".) W.O.W.S = Wolf Of Wall St (I didn't want to offend anybody).
Anyhow...
I just couldn't get the Logical Tests, Comma's, Brackets, True & Falsities to all line up properly, resulting in numerous and varied errors!... Blugh!??
Probably because i've been going about it the complete wrong way.
Thanking you all most generously.
Connect Part 1 and 2, keep one Blank, use Conditional Formatting
Not so difficult, except you included blank twice instead of once. I suggest putting Part 1 and Part 2 into a single formula with only one blank as a final option. And, yes: formula gets more complex. Here is an example, based on your Case 1: Enter this into J1:
=IF(AND(L1<11,K1<1.40)=TRUE,"LHF10",IF (AND(L1<11,K1 > 1.90, K1<3.00)=TRUE, "LHD10","")
Conditional formatting for J1: if LHF10, colour Light Green, if LHD10, colour Tan.
Copying to rows to the bottom is not problem either, you just need to use relative references.
Cell formatting is easy with Conditional Formatting, depending on formula result.
I use Excel 2010 on WindowsXP, and it works fine. Anyway, I don't think you need Excel 2010 for such a formula. Excel 2003 supports up to 3 conditional formattings per cell, and you need only 2.