How to return blank cell with if/and functions

PAB1020

New Member
Joined
Dec 21, 2018
Messages
14
Office Version
  1. 365
Platform
  1. Windows
For cell H2, =IF(AND($F$2>0,G2=0),"N/A",(($G$2-$F$2)/$G$2)) works fine when F2>0 and G2=0, and shows correct percentage difference between the two when values for both cells are entered.
However, if I copy that formula down the column, I get #DIV/0!.
I've tried adding another IF statement whe3n F2 is blank, but I keep getting error messages.
What can I add to this formula to return a blank cell H2 if F2 is blank?
Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
you have fixed F2 with the $'s and G2 is free to change
so as you copy down it will be
=IF(AND($F$2>0,G2=0),"N/A",(($G$2-$F$2)/$G$2))
=IF(AND($F$2>0,G3=0),"N/A",(($G$2-$F$2)/$G$2))
=IF(AND($F$2>0,G4=0),"N/A",(($G$2-$F$2)/$G$2))

But still returning the same calculation

is that what you expect
as f2 is not changing

but if you want the cell to be blank

=IF($F$2="","" , IF(AND($F$2>0,G2=0),"N/A",(($G$2-$F$2)/$G$2)))
 
Upvote 0
Solution
Thanks - got it
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,616
Latest member
intern444

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