MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Greater than and Less than formula?


Posted by Scott Himes on January 01, 2002 11:02 AM

I have to do the following:
If cell a1 is less than 243.9 then = "none"
if cell A1 is more than 243.9 but less than 390.7 = "1"
if A1 is more than 390.7 but less than 583.7 = "2"

That's the idea of it I have to this for 12 different ranges. Can anyone help me with this?

Thank you all in advance to the help.

Scott


Posted by Aladin Akyurek on January 01, 2002 11:07 AM

Scott --

Make a 2-column list in some worksheet in your workbook as follows:

0 none
243.9 1
390.7 2
583.7 3
etc.

Select all of the cells of this 2-column list and give it a name, say TABLE, via the Name Box on the Formula Bar.

Then use the following formula:

=VLOOKUP(A1,TABLE,2)

Aladin