1

Is it possible to have multiple IF for one Cell? example if leftA1 =4455,"Maro" if=5522, "John" and so on... I work in shipping and when I scan a product shipping label I need it to show the courier company/ Thank you

Mario Trad
  • 11
  • 1
  • For more info see https://support.microsoft.com/en-us/office/if-function-nested-formulas-and-avoiding-pitfalls-0b22ff44-f149-44ba-aeb5-4ef99da241c8 – Gantendo Mar 08 '22 at 16:07
  • What do you get when you try it? – Toto Mar 08 '22 at 16:08
  • https://support.microsoft.com/en-us/office/ifs-function-36329a26-37b2-467c-972b-4a39bd951d45 IFS function. – Lee Mar 09 '22 at 09:32

2 Answers2

4

You can nest IFs:

=IF(LEFT(A1,4)="1z33","UPS",IF(LEFT(A1,4)="4455","fedex",...))

continue nesting them till you have exhausted the list.

You can also use IFS if you have it:

=IFS(LEFT(A1,4)="1z33","UPS",LEFT(A1,4)="4455","fedex",...)

You can also use NDEX/MATCH if it is always looking at the first four characters:

=INDEX({"UPS","fedex",...},MATCH(LEFT(A1,4),{"1z33","4455",...},0))
Scott Craner
  • 22,693
  • 3
  • 21
  • 25
0

I'd recommend to use SWITCH():

=SWITCH(LEFT(A1,4),"1z33","UPS","4455","FEDEX")

You can build out this formula with up to 126 options.

JvdV
  • 2,217
  • 6
  • 13