If Formula returning #Value error

leepju

New Member
Joined
Aug 13, 2018
Messages
4
Hi Guys -

I have been trying to make this formula work for a very long time. Following is the formula:

=IF(AND(B2="Yes",X2="3000",AE2="SG&A"),"SG&A"),(IF(AND(AE2="R&D",AK2="Not Applicable"),"R&D -Non LOH"," "),(IF(AND(AE2="R&D",AK2="Yes-Yes"),"R&D - LOH"," ")))

There are multiple conditions to meet in this formula. All of these statements are working if I break these into three. But when I combine them it gives me #value error:ROFLMAO:. Any help would be highly appreciate!!

Thanks in advance guys.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Welcome to the Board!

You are closing your parentheses too early. Try this:
Code:
[COLOR=#333333]=IF(AND(B2="Yes",X2="3000",AE2="SG&A"),"SG&A",IF(AND(AE2="R&D",AK2="Not Applicable"),"R&D -Non LOH",IF(AND(AE2="R&D",AK2="Yes-Yes"),"R&D - LOH"," ")))[/COLOR]
 
Upvote 0
Ah, all the good one are already taken... Just one more quick question for sake of knowledge. My formula was supposed to be like this:

=IF(AND(B2="Yes",X2="3000",AE2="SG&A"),"SG&A",IF(AND(AE2="R&D",AK2="#N/A"),"R&D -Non LOH",IF(AND(AE2="R&D",AK2="Yes-Yes"),"R&D - LOH"," ")))

I had to change all #n/a to not applicable to make this formula work. Otherwise it would give me #N/A error in a result. Just curious, anyway around that?

Thanks again for your help. Highly appreciated.
 
Upvote 0
There is a difference in checking to see if a cell has a literal text value of "#N/A" (which is what yours would check), and the #N/A error that is returned when it cannot find a value.
If checking for the #N/A error, you would use the ISNA function, i.e.

So instead of
Code:
[COLOR=#333333]AK2="#N/A"[/COLOR]
try
Code:
[COLOR=#333333]ISNA(AK2)[/COLOR]

See here for details on the ISNA function: https://www.techonthenet.com/excel/formulas/isna.php
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,860
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top