Thread: Formula syntax
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Formula syntax

One way...

=IF(OR(K3="",M3=""),"",VLOOKUP(LEFT(K3)&M3,{"4A"," CTA";"4C","STD";"5A","STA";"5C","GIL"},2,0))

Or, create a little table:

...........A..........B
1.......4A.......CTA
2.......4C.......STD
3.......5A.......STA
4.......5C.......GIL

Then:

=IF(OR(K3="",M3=""),"",VLOOKUP(LEFT(K3)&M3,A1:B4,2 ,0))

--
Biff
Microsoft Excel MVP


"Dale G" wrote in message
...
Hi, I'm trying place a formula in cell C3.

IF(AND(K3="","",IF(LEFT(K3)="4",M3="a"),"CTA","STD "),IF(AND(K3="","",IF(LEFT(K3)="5",M3="a"),"STA"," Gil"))

I'm trying to have cell C3 show CTA if the number in K3 starts with a 4
and
the letter in M3 is "a". And if the number in K3 starts with a 4 and the
letter in M3 is "c"
have C3 show STD.

Or if the number in K3 starts with a 5, and M3 is "a" have C3 show STA, or
if K3 starts with a 5 and M3 is "c" then C3 would show Gil.

Any help is appreciated.