View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tjtjjtjt tjtjjtjt is offline
external usenet poster
 
Posts: 51
Default simplify VLOOKUP with conditions

I wrote this funciton as a quick fix for a collegue.
It looks for a comma in the cell.
No comma = standard VLOOKUP
Comma = concatenate 2 VLOOKUPs
I would like to make the formula flexible enough to handle more than 1 comma
and to handle situations when there is a slash instead of a comma.

=IF(ISERROR(FIND(",",C4,1)),VLOOKUP(C4,Cat!$A$2:$B $129,2,FALSE),VLOOKUP(LEFT(C4,(FIND(",",C4,1)-1)),Cat!$A$2:$B$129,2,FALSE)&",
"&VLOOKUP(MID(C4,FIND(",",C4,1)+1,255),Cat!$A$2:$B $129,2,FALSE))

--
tj