want to return "n/a" or "0"
Hi, I am trying to do a formula that will either return a percentage or if either of two cells are blank, then I want it to return either a "0" or "n/a". Here is my formula =(J5/H5)-100% (this gives me the recipacal of the percentage). It works fine. Now what do I add to get it to return either "0" or "n/a" if either J5 or H5 is blank or both are blank? Hope this makes sense. Background - I am trying to divide one number by another to get the percentage of the difference 8/10-100%=20% but if there are no numbers in the cells and nothing to divide, then I want it to return "0" or "n/a". Thanks. -- edrachel ------------------------------------------------------------------------ edrachel's Profile: http://www.excelforum.com/member.php...fo&userid=4736 View this thread: http://www.excelforum.com/showthread...hreadid=505888 |
want to return "n/a" or "0"
=IF(OR(H5="",J5=""),"N/A",(J5/H5)-100%) Hope it helps -- goober ------------------------------------------------------------------------ goober's Profile: http://www.excelforum.com/member.php...o&userid=19838 View this thread: http://www.excelforum.com/showthread...hreadid=505888 |
want to return "n/a" or "0"
One way:
=IF(OR(J5="",H5=""),"n/a",(J5/H5)-100%) Hope this helps. George Gee "edrachel" wrote in message ... Hi, I am trying to do a formula that will either return a percentage or if either of two cells are blank, then I want it to return either a "0" or "n/a". Here is my formula =(J5/H5)-100% (this gives me the recipacal of the percentage). It works fine. Now what do I add to get it to return either "0" or "n/a" if either J5 or H5 is blank or both are blank? Hope this makes sense. Background - I am trying to divide one number by another to get the percentage of the difference 8/10-100%=20% but if there are no numbers in the cells and nothing to divide, then I want it to return "0" or "n/a". Thanks. -- edrachel ------------------------------------------------------------------------ edrachel's Profile: http://www.excelforum.com/member.php...fo&userid=4736 View this thread: http://www.excelforum.com/showthread...hreadid=505888 |
All times are GMT +1. The time now is 09:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com