ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Embetting Vlookup in IF statement (https://www.excelbanter.com/excel-programming/359076-embetting-vlookup-if-statement.html)

[email protected]

Embetting Vlookup in IF statement
 
I want to look at a cell and if it has a certain value, return another
value in my target cell but if it has some other value, I what excel to
look at a table and find the value and return the cell value?

For example. I have a cell where the value is SP. If the value is SP,
then put Super Puppy in my target cell. But if excel looks at the cell
and it is not SP, but TO, I want excel to go to a table and lookup a
then value in the cell (TO) and put Totally Outrageous in that cell. If
the cell has something else, it would lookup that value and place it in
that cell.

Anyone know how to do this?

Thanks.


Chip Pearson

Embetting Vlookup in IF statement
 
Try something like

=IF(A1="SP","Super Puppy",VLOOKUP(A1,B1:C10,2,FALSE))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



wrote in message
oups.com...
I want to look at a cell and if it has a certain value, return
another
value in my target cell but if it has some other value, I what
excel to
look at a table and find the value and return the cell value?

For example. I have a cell where the value is SP. If the value
is SP,
then put Super Puppy in my target cell. But if excel looks at
the cell
and it is not SP, but TO, I want excel to go to a table and
lookup a
then value in the cell (TO) and put Totally Outrageous in that
cell. If
the cell has something else, it would lookup that value and
place it in
that cell.

Anyone know how to do this?

Thanks.




Dave Peterson

Embetting Vlookup in IF statement
 
It sounds like an =vlookup() formula would be what you're looking for:

=if(a2="","",vlookup(a2,sheet2!a:b,2,false))

You may want to read Debra Dalgleish's notes:
http://www.contextures.com/xlFunctions02.html

wrote:

I want to look at a cell and if it has a certain value, return another
value in my target cell but if it has some other value, I what excel to
look at a table and find the value and return the cell value?

For example. I have a cell where the value is SP. If the value is SP,
then put Super Puppy in my target cell. But if excel looks at the cell
and it is not SP, but TO, I want excel to go to a table and lookup a
then value in the cell (TO) and put Totally Outrageous in that cell. If
the cell has something else, it would lookup that value and place it in
that cell.

Anyone know how to do this?

Thanks.


--

Dave Peterson

[email protected]

Embetting Vlookup in IF statement
 
Great. Thanks Chris. I got that to work.

John


[email protected]

Embetting Vlookup in IF statement
 
Thank you Dave. I am new to this stuff and it is exciting to see it
work.


JOhn



All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com