Excel Lookup

S

scarlet

I am trying another option here

In one column I have alist of equipment and I want another column to
look up the value of this column for example

Row Column A Column B

1 15kva If column A shows a 15kva I want to put
2 20kva the value £20.00 in column B
3 15kva
4 15kva

So I get the result

Row Column A Column B

1 15kva £20.00
2 20kva £0.00
3 15kva £20.00
4 15kva £20.00

Apologies I know this may seem simple to most but I am not too good
with Excel
 
D

Don Guillett

good time to learn how to use HELP within excel.
try the help index for

IF

--
Don Guillett
SalesAid Software
[email protected]
I am trying another option here

In one column I have alist of equipment and I want another column to
look up the value of this column for example

Row Column A Column B

1 15kva If column A shows a 15kva I want to put
2 20kva the value £20.00 in column B
3 15kva
4 15kva

So I get the result

Row Column A Column B

1 15kva £20.00
2 20kva £0.00
3 15kva £20.00
4 15kva £20.00

Apologies I know this may seem simple to most but I am not too good
with Excel
 
S

scarlet

I have used help otherwise I would not be asking. I simply do not
understand the logic of it, I know the end result but I simply do not
understand the true, false, vlookup, array etc. I am pulling my hair
out and spent nearly 5hrs trying to work it out and I am no further
forward

But thanks for your comment!
 
C

CLR

Assuming your first "15kva" is in cell A2, in B2 put this and format for
your currency........

=IF(S2="15KVA",20.00,0)

If you wanted more than just that single condition, that is where you would
get into the VLOOKUP function. You would have to build a VLOOKUP table,
usually two columns or more, possibly NAME that range and then use the
VLOOKUP formula in B2, something like this..........

=VLOOKUP(A2,YourVlookupTable,2,FALSE) , where the "2" means the result you
want is in the second column of the table, and the FALSE means you do not
want any answer other than for an exact match.

hth
Vaya con Dios,
Chuck, CABGx3


I am trying another option here

In one column I have alist of equipment and I want another column to
look up the value of this column for example

Row Column A Column B

1 15kva If column A shows a 15kva I want to put
2 20kva the value £20.00 in column B
3 15kva
4 15kva

So I get the result

Row Column A Column B

1 15kva £20.00
2 20kva £0.00
3 15kva £20.00
4 15kva £20.00

Apologies I know this may seem simple to most but I am not too good
with Excel
 
C

CLR

Sorry, my typeO..........should have been
=IF(A2="15KVA",20.00,0)

Vaya con Dios,
Chuck, CABGx3
 
S

scarlet

Many thnaks CLR you are a gem.

Don whilst I appreciate your incredible help through tongue in cheek
sarcasm. We all have to start somewhere, and now I can see I was going
down the wrong route at least I was having a go. I also know there are
people out there willing to help and I know where to ask. Its very
easy to fall into a condacendng manner of I know the answer and you
dont so I will give you a snippet. Its like when we have passed our
driving test, we all had to start somewhere and we curse the learners,
what we tend to forget we were all there at the same point at sometime!

As much as I refrained from asking the question, I had spent an
incredible amount of time trying to figure it out, which I failed
miserably, but thanks to those of you who did reply and had patience ;-)
 
K

Ken Wright

It's easy to get lost in a formula if you don't really understand what the
formula is actually
doing:-

The VLOOKUP function essentially takes a value that you specify, whether it
be a hardcoded
number/letter/text or a value within a cell reference, and then goes and
looks it up in a table.
It will look for that value in the leftmost column of the table, and either
find it or the closest
match, and will then return the corresponding value on the same row, in
whatever column of that
table that you tell it to:-

Example - With the following table

D E
1 1 0.20
2 10 0.25
3 20 0.30
4 30 0.35
5 40 0.40

and with your value that you are looking up in say cell A1 (and let's assume
it is 25 for
example).

You can put a formula in pretty much any other cell, that says, take the
value in cell A1 (25), go
and look for it in the lefthand column of the table (D1:D5), and then when
you have found it (or
the lowest closest number to it), go to the second column (or whichever one
you specify if there
are more than 2) and give me the number that it is on the same row in that
column.

So, with the formula being =VLOOKUP(A1,D1:E5,2) it will first take the
value in A1 which is 25,
then go look for it in the leftmost column (D) of your specified table
(D1:E5), and it will try to
find that number. Now it isn't there, so what it will do is look for the
next lower closest
number, which in this case will be 20, and the 2 in the formula says to go
and get the value in
the 2nd column (E) in your table, that is on the same row as the 20. That
value in this case is
0.3

If you put the value 30 or 31 or 32 etc into A1 now, you will see the result
of the formula
change, because now it will either find those numbers or the lower closest
number (and in each
case there it is 30), and will subsequently return 0.35 as the corresponding
value.

Just to show you how the 2 really works in that formula, if you added one
more column to your
table so that it looked like this:-

D E F
1 1 0.20 0.15
2 10 0.25 0.25
3 20 0.30 0.35
4 30 0.35 0.45
5 40 0.40 0.55

and you actually wanted the value from Col F, then you would simply change
the 2 in the formula
to a 3 to signify the third column, eg:-

=VLOOKUP(A1,D1:E5,3)

With the examples already given, 25 in A1 would return 0.35, and 30/31/32
would return 0.45

The one caveat to all of this (When getting the nearest number is OK) is
that the data in your
leftmost column must be sorted in ascending order.


There are times when you would only want it to give you a value if you had
an exact match on the
number, and in this instance you would simply add a 4th argument of 0 or
FALSE to the formula,
eg:-

=VLOOKUP(A1,D1:E5,3,0)

or

=VLOOKUP(A1,D1:E5,3,FALSE)

In these cases you do not need to have the data in your leftmost column
sorted.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------­------------------------------­----------------
It's easier to beg forgiveness than ask permission :)
------------------------------­------------------------------­----------------

I am trying another option here

In one column I have alist of equipment and I want another column to
look up the value of this column for example

Row Column A Column B

1 15kva If column A shows a 15kva I want to put
2 20kva the value £20.00 in column B
3 15kva
4 15kva

So I get the result

Row Column A Column B

1 15kva £20.00
2 20kva £0.00
3 15kva £20.00
4 15kva £20.00

Apologies I know this may seem simple to most but I am not too good
with Excel
 
Top