If then statements?

H

Hickeym

Hello,
I am attempting to do a calculation in Excel and I am not sure how to
proceed. The idea is the following:

if cell A2 equals a specific word (text), like "Adult", then I want it to
grab cell B2 which is a % and put it into cell A3. However, there can be up
to four "words" and depending on which word is in the cell, it needs to grab
a different cell with a different % in it and put THAT into another cell.

For example - A2 equals "Adult", cell B2 equals 100%, I want cell A3 to
equal 100%.
Cell B2 needs to be able to be change to any %...

The final cell is then a part of another formula.

Thanks
 
B

Bob Umlas, Excel MVP

in cell A3:
=IF(A2="Adult",B2,IF(A2="word2",B3,IF(A2="word3",F12,IF(A2="word4",N12))))
 
E

Elkar

You can "nest" IF Statement inside of other IF Statements. For example:

=IF(A2="Adult",B2,IF(A2="Child",B3,IF(A2="Senior",B4,B5)))

This formula will check A2.
IF A2 = "Adult" then pull value of B2
IF A2 = "Child" then pull value of B3
IF A2 = "Senior" then pull value of B4
Otherwise, pull value of B5

Does that help?
Elkar
 
N

Niek Otten

=IF(A2="adult",B2,IF(A2="child",C2,IF(A2="grandpa",D2,E2)))

But much better would be to use the VLOOKUP() function.

See this nice introduction:

http://www.contextures.com/xlFunctions02.html

--
Kind regards,

Niek Otten

| Hello,
| I am attempting to do a calculation in Excel and I am not sure how to
| proceed. The idea is the following:
|
| if cell A2 equals a specific word (text), like "Adult", then I want it to
| grab cell B2 which is a % and put it into cell A3. However, there can be up
| to four "words" and depending on which word is in the cell, it needs to grab
| a different cell with a different % in it and put THAT into another cell.
|
| For example - A2 equals "Adult", cell B2 equals 100%, I want cell A3 to
| equal 100%.
| Cell B2 needs to be able to be change to any %...
|
| The final cell is then a part of another formula.
|
| Thanks
 
Top