Forum Discussion
Is it possible to create an if-command from a table?
Let's say I have a table like this:
ID | Name |
1 | James |
2 | David |
3 | Jackie |
I want to have a cell (A4) show me the name of a person based on their ID number shown in another cell (A3).
In the A4 cell I write "IF(A3=1;"James";A3=2;"David";A3=3;"Jackie"). That works.
However, the list I am working with is way longer than 3 invidviduals. Is there a easier or quicker way to make such an IF-command without having to write the whole command with A3=1;"James";A3=2;"David".. and so on?
Thanks in advance,
Thor
5 Replies
- Patrick2788Silver Contributor=CHOOSE(A3,"James","David","Jackie")
HelloThorkild1991
If you're using Office 365 or Microsoft Office 2019 version, you can easily deploy the IFS function which will handle multiple nested IF statement in older versions.
See an example of the IFS function in the attached caption
- TwifooSilver Contributor
In D2, you can enter a formula like:
=LOOKUP)C2,A$2:B$4)
Note that ID's are in A2:A4 and Names are in B2:B4.