• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 46
  • Last Modified:

MS Excel - Multiple Criteria for If statement

Hi,

Can you please help create an If statement that returns the following?  

Column A = Forms,  I need the value to return as a "A"
Column A = Pages, return the value "B"
Column A = Headers, return the value "C"
Column A = Footers, return the value "D"
Column A = Body, return the value "E"
0
Wonderwall99
Asked:
Wonderwall99
1 Solution
 
Martin AndrewsCommented:
=IF(A1="Forms","A", IF(A1="Pages","B", IF(A1="Headers","C", IF(A1="Footers","D", IF(A1="Body","E","")))))
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
One way is this....

In B2
=CHOOSE(MATCH(A2,{"Forms","Pages","Headers","Footers","Body"},0),"A","B","C","D","E")

Open in new window


The best way is to create a lookup table and use Vlookup formula to get the desired output if there are more criteria to be compared.
1

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now