Excel help - hide % formula when not needed

Andy Kirk
New Contributor



I'm trying and currently failing to write what i thought was a simple spreadsheet for some company purchases but am struggling to reflect that some purchases are subject to VAT whilst others are not. 


I have added a simple formula in cell H5 to show the VAT paid as a % - in this case =G5/F5 where G is the VAT paid and F is the total amount paid.  I have formatted H5 to be a percentage, and everything works fine when the cells G5 and F5 have data in them.


I have copied the formula down the H column, so now all the H row entries have the following displayed in them: #DIV/0! if there is no data in the G and F cells.


I don't want to have to hide all the formulas and protect the sheet, so I was wondering if there is another way to make the H row column cells remain blank if there is no entry in the corresponding G column cells - i.e. if there's no VAT showing as being paid, to make the % column blank (or 0) - rather than displaying the formula text of #DIV/0!


Any help is appreciated.






Many thanks!



3 Replies

Hi Andy,


You may use




Many thanks - problem solved!



Andy, you are welcome

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies