VLOOKUP Range

A

apb000

Is there a way to have excel look up data that falls BETWEEN two numbers,
i.e. in a range, and return a specified character string? For example, "If
(value) is between B12 and B13, return "Tuesday"". I could always do it with
IF THEN statements, of course, but I'd have to make A LOT of them, and they'd
be huge, elaborate statements. Can't I just do it from a table of values?
 
S

ShaneDevenshire

Hi,

Create a lookup table, in say range D1:E3, such as:
0 Mon
10 Tue
30 Wed

in cell A1 enter a value like 20, in A2 enter the formula
=VLOOKUP(A1,D1:E3,2,1)

The lookup table must be sorted in Ascending order on the first column
because we are doing an approximate match. You can shorten the above formula
to
=VLOOKUP(A1,D1:E3,2)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top