Multiple IF arguments
Solved/Closed
Related:
- Multiple IF arguments
- Allow multiple downloads chrome - Guide
- How to delete multiple files on mac - Guide
- Photoshop multiple selections - Guide
- Mpc-hc multiple instances - Guide
- How to share multiple contacts on android - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Nov 2, 2021 at 01:02 PM
Nov 2, 2021 at 01:02 PM
Hi Tim,
Nested IF's have been limited to 7. You could use additional cells to put in more IF's, but the best way to get past this limitation is to use a user defined function.
Here is what it looks like:
To use this function press Alt+F11 to open the VBA window. In the top menu > insert > module. Paste the code in the big white field. You can close this window now.
Back in Excel, use the function like this:
=CellCombi(A1,B1)
Let us know if something is unclear.
Best regards,
Trowa
Nested IF's have been limited to 7. You could use additional cells to put in more IF's, but the best way to get past this limitation is to use a user defined function.
Here is what it looks like:
Function CellCombi(cell1, cell2 As Range) As String If cell1 = "a" And cell2 = "a" Then CellCombi = "aa" If cell1 = "b" And cell2 = "a" Then CellCombi = "ba" If cell1 = "c" And cell2 = "a" Then CellCombi = "ca" If cell1 = "d" And cell2 = "a" Then CellCombi = "da" If cell1 = "e" And cell2 = "a" Then CellCombi = "ea" 'etc.. End Function
To use this function press Alt+F11 to open the VBA window. In the top menu > insert > module. Paste the code in the big white field. You can close this window now.
Back in Excel, use the function like this:
=CellCombi(A1,B1)
Let us know if something is unclear.
Best regards,
Trowa
Nov 2, 2021 at 08:24 PM