Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
CASE
I want to do something similar to CASE in SQL. That is if cell A1 is 'A' then
I went 'ACTIVE' in B1. if cell A1 is 'D' then I went 'DELETED' in B1. if cell A1 is 'C' then I went 'CLOSED' in B1. How to do this? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
CASE
One way ..
Put in B1: =IF(A1="","",VLOOKUP(A1,{"A","ACTIVE";"D","DELETED ";"C","CLOSED"},2,0)) -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "GregNga" wrote: I want to do something similar to CASE in SQL. That is if cell A1 is 'A' then I went 'ACTIVE' in B1. if cell A1 is 'D' then I went 'DELETED' in B1. if cell A1 is 'C' then I went 'CLOSED' in B1. How to do this? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
CASE
Could you possibly explain how this logic works. I looked up VLOOKUP on MS
help and it's not very clear Thanks again "Max" wrote: One way .. Put in B1: =IF(A1="","",VLOOKUP(A1,{"A","ACTIVE";"D","DELETED ";"C","CLOSED"},2,0)) -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "GregNga" wrote: I want to do something similar to CASE in SQL. That is if cell A1 is 'A' then I went 'ACTIVE' in B1. if cell A1 is 'D' then I went 'DELETED' in B1. if cell A1 is 'C' then I went 'CLOSED' in B1. How to do this? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
CASE
"GregNga" wrote:
Could you possibly explain how this logic works... VLOOKUP(A1,{"A","ACTIVE";"D","DELETED";"C","CLOSED "},2,0) The fixed table_array used in the vlookup, ie: {"A","ACTIVE";"D","DELETED";"C","CLOSED"} is the same as a 2 col x 3 row range on the sheet: A ACTIVE D DELETED C CLOSED The lookup value in A1 is compared with the values within the 1st col above, and where it matches exactly*, the corresponding value in the 2nd** col will then be returned by the vlookup *exact matching is specified by the last zero (or FALSE) in the vlookup(..,2,0) **that's the col index num: 2 in the vlookup(..,2,0) -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to change mixed case to upper case in Excel for all cells | Excel Discussion (Misc queries) | |||
Change the text from lower case to upper case in an Excel work boo | Excel Discussion (Misc queries) | |||
How do I change a column in Excel from upper case to lower case? | Excel Worksheet Functions | |||
How do I change existing text from lower case to upper case | Excel Discussion (Misc queries) | |||
How to use formula auditing to change upper case to Title Case. | Excel Worksheet Functions |