I am trying to figure a better method than using a Nested IF statement with 18 IFs. The below example is only 3 IFs, but my data has 18 columns of amounts. I have to assign an Account_No based on if there is a value in an Amount column. I couldn't figure out how to use VLOOKUP for this. Not sure if INDEX and MATCH will work.
The formula for AccountNo field is:
=IF(B2<>0,"12345",IF(C2<>0,23456,IF(D2<>0,34567,99999)))
I am using Excel 2013 so IFS won't work.
Any help would be appreciated. Thanks.
[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD]Company
[/TD]
[TD]Sales
[/TD]
[TD]COGS
[/TD]
[TD]Interest
[/TD]
[TD]GLAccount_No
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$5000
[/TD]
[TD]$0
[/TD]
[TD]$00
[/TD]
[TD]12345
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$600
[/TD]
[TD]$0
[/TD]
[TD]23456
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$0
[/TD]
[TD]$250
[/TD]
[TD]34567
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$0
[/TD]
[TD]$0
[/TD]
[TD]99999
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$75
[/TD]
[TD]$0
[/TD]
[TD]23456
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The formula for AccountNo field is:
=IF(B2<>0,"12345",IF(C2<>0,23456,IF(D2<>0,34567,99999)))
I am using Excel 2013 so IFS won't work.
Any help would be appreciated. Thanks.
[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD]Company
[/TD]
[TD]Sales
[/TD]
[TD]COGS
[/TD]
[TD]Interest
[/TD]
[TD]GLAccount_No
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$5000
[/TD]
[TD]$0
[/TD]
[TD]$00
[/TD]
[TD]12345
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$600
[/TD]
[TD]$0
[/TD]
[TD]23456
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$0
[/TD]
[TD]$250
[/TD]
[TD]34567
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$0
[/TD]
[TD]$0
[/TD]
[TD]99999
[/TD]
[/TR]
[TR]
[TD]XYZ
[/TD]
[TD]$0
[/TD]
[TD]$75
[/TD]
[TD]$0
[/TD]
[TD]23456
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]