Home > Enterprise >  Multiple IFs in 1 formula
Multiple IFs in 1 formula

Time:10-02

I'm trying to extract sections of text from an Excel cell then put some of those parts together. Using LEFT, MID, TRIM, SUBSTITUTE & REPT (mainly helped by contributions on this site), I've managed to split each section down (they are separated by dashes) into it's constituent parts. I've managed to do the easy bit which is to add sections 2 and 3 together (separated by dashes) using =L2&"-"&M2&"-"&. I want to add the last section but the problem I have is that some of the names have 5 sections, some 6 and some 7 so I need a formula that says something like "If cells 9 & 10 are empty, use cell 8, if cell 10 is empty use 9 and if neither 9 or 10 are empty, use 10". I've had a go with IF and AND but keep getting error messages, mainly about too many arguments. Any help would be much appreciated, I still quite a newbie to formula writing.

CodePudding user response:

Assuming sections 8,9 and 10 are in columns R:T, you could use:

=LOOKUP(2,1/(R2:T2<>""),R2:T2)
  • Related