Conditional Formula to ignore text fields.

MattMax

New Member
Joined
Nov 13, 2009
Messages
34
Dear Excel Ninjas,

I'm looking to write a formula that ignores cells that have "NA" in them.

The exact formula is: =F8/((B8/B12)+(C8/C12)+(D8/D12)+(E8/E12))

The catch is that if any of those cells within the parenthesis have a value of "NA" then that divided pair should = 0.
So if B8 = "NA", B8/B12 = 0, or if B12 = "NA", B8/B12 = 0.

Would prefer to do this with an excel formula rather then a macro. Would appreciate any pointers.

Thanks in advance.
MattMax
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I think I might have it with a If(And(ISNUMBER)) function... trying to string them together now.
 
Upvote 0
MattMax

Assuming that NA is a value in your data rather than a #N/A error then for (B8/B12) substitute .......

IF(ISNUMBER(B8/B12),C8/C12,0)


and similar for the C8/C12 and D8/D12

Hope this helps?
 
Upvote 0
Thanks..

I ended up going with this giant formula that is working nicely (cells are different positions then in my example):

=W7/((IF(AND(ISNUMBER(F7),ISNUMBER(J7)),J7/F7,0)+(IF(AND(ISNUMBER(G7),ISNUMBER(M7)),M7/G7,0))+(IF(AND(ISNUMBER(H7),ISNUMBER(P7)),P7/H7,0))+(IF(AND(ISNUMBER(I7),ISNUMBER(S7)),S7/I7,0))))
 
Upvote 0
Hey, why use the nutcrackers if you have a sledgehammer handy!!??:LOL:
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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