Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If then statements?
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If then statements?
in cell A3:
=IF(A2="Adult",B2,IF(A2="word2",B3,IF(A2="word3",F 12,IF(A2="word4",N12)))) "Hickeym" wrote: 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 |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If then statements?
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 "Hickeym" wrote: 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 |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If then statements?
=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 "Hickeym" wrote in message ... | 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel MS Query multiple select statements | Excel Discussion (Misc queries) | |||
UDFunctions and nested If-the-else statements | Excel Worksheet Functions | |||
Linking two IF statements together | Excel Discussion (Misc queries) | |||
Better Way to Code IF Statements? | Excel Discussion (Misc queries) | |||
Nested IF statements | Excel Worksheet Functions |