I need help with code for excel.
What I need is if a cell contains "Achieved" then display 1, "Partially Achieved" display 2 and if "Not Achieved" display 3.
Can someone help with what I need to enter?
Thanks
I need help with code for excel.
What I need is if a cell contains "Achieved" then display 1, "Partially Achieved" display 2 and if "Not Achieved" display 3.
Can someone help with what I need to enter?
Thanks
=IF(A1="Achieved",1,IF(A1="Partially Achieved",2,IF(A1="Not Achieved",3,"NA")))
Try,
=iferror(match(A1, {"Achieved", "Partially Achieved", "Not Achieved"}, 0), "")
fwiw, to perform the reverse (with 1, 2 or 3 in a cell) use,
=iferror(choose(A1, "Achieved", "Partially Achieved", "Not Achieved"), "")
=SWITCH(A1,"Achieved",1,"Partially Achieved",2,"Not Achieved",3)
Where A1 is the cell you want to check of course.
For those without SWITCH (and half the length):
=MATCH(LEFT(A1),{"A","P","N"},0)