Long formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wanted to shorten this formula throw lookup function. Please help me on this.

=If(A1=1,"a",if(a1=2,"b",if(a1=3,"C",if(a1=4,"D",if(a1=5,"V","")))))

Thanks & regards

jai
 
Hi Jai,

One way,
Put your values in a table format out of the way somewhere.
Say like this
L1: 1 M1: a
L2: 2 M2: b
L3: 3 M3: C
L4: 4 M4: D
L5: 5 M5: V

Then put this formula in B1
=VLOOKUP(A1,L1:M4,2,FALSE)

Keep changing the value in A1 to see it working
Then see the Help file for more info.

HTH
Martin
 
I've added a bit of error handling:
=IF(A1<1,"",IF(A1>5,"",CHOOSE(A1,"a","b","C","D","V")))
 
And another one just to show you some other options
=LOOKUP(A1,{1,2,3,4,5},{"a","b","C","D","V"})

HTH
Martin
 
Back
Top