Forum Discussion

LUKEHARWELL22's avatar
LUKEHARWELL22
Copper Contributor
Oct 15, 2021
Solved

help determining proper function to use

I need help determining the proper function if one exists.

 

I am comparing 2 different cells to determine a number to place in another cell.

The basis is: 

IF c2="NIL" and d2="ASCUS" then "1/2" should be in e2  OR

IF c2="NIL" and d2="LSIL" then "1" should be in e2  OR 

IF c2="NIL" and d2="HSIL" then "2" should be in e2. 

 

There are multiple other comparison I want to make also. So maybe 6 different comparisons in e2. 

 

Thanks. 

3 Replies

  • LUKEHARWELL22 

    I'd create a small lookup table. In the screenshot below, it is in H2:I7.

    The formula in E2 is

    =IF(C2="NIL",VLOOKUP(D2,$H$2:$I$7,2,FALSE),"")

    • LUKEHARWELL22's avatar
      LUKEHARWELL22
      Copper Contributor
      Hey thanks for that. That will probably be my best bet going forward. Now to add other scenarios. with c2.

      if c2=ascus and d2=nil then e2="1/2 or
      if c2=lsil and d2=nil then e2=1 or
      c2=hsil and d2=ascus then e2=2.

      How can I do vlookup with c2 being multiple different things?
      thanks.

Resources