#Value! errors

thecat23

New Member
Joined
Apr 6, 2019
Messages
19
Office Version
  1. 365
Hi all,

I am trying to assign a formula to a cell "W21" that is reference to cell"B21", if it's Not empty, then the cell "W21" = 0, if empty then "W21" = "", which is nothing.

Then the cell "W21" is used by other cell to do numerical calculations, to simply it, say another cell is = 100 + "W21", this would return a error #Value!, but if I type = Sum(100; W21), this is working fine. The issue is that the formula in other cell is too complicated to replace it with simple functions, Sum, subtraction, etc. is any other way to bypass this? it seems the cell "W21" contains a formula, so when a "" is assigned to the cell, it does not treated as a empty space with isblank(). so when it was used by other formula, a error would occur.

any ideas? thanks!

VBA Code:
Activesheet.Range("W21").Formula = "=IF(B21<>"""",0,"""")"
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You can't do mathematical operations on an empty string so you either have to just return 0 instead of "" (which makes your formula pretty pointless) or adjust your other formulas to account for W21 having an empty string in it.
 
Upvote 0
You can't do mathematical operations on an empty string so you either have to just return 0 instead of "" (which makes your formula pretty pointless) or adjust your other formulas to account for W21 having an empty string in it.
Thanks for your comments.
I was trying to make the cells display nothing if the lookup cell is empty, and autofill the cell with a value when the lookup cell is filled. I guess I have to forget about this one.

Thanks anyway.
 
Upvote 0
Have you looked at the IFERROR function, you could wrap your current formulae with it and ask it to return "" instead of the error?
 
Upvote 0
Have you looked at the IFERROR function, you could wrap your current formulae with it and ask it to return "" instead of the error?
Hi Georgiboy,

IFERROR still returns a "" which is the cause of the error. Unless it returns a empty number like 0 then it's fine. Then it kind of defeat the purpose since I was trying to get a blank cell when the lookup cell is has nothing in it instead of a number 0. I guess I could use IFERROR in the other cells that does the calculations to treat this cell as 0 if error is obtained, but this would take too long to fix.

I will keep thinking the ways around it.

Thanks for your comments.
 
Upvote 0
Do you want to show us an example of a follow on formula and what result you are hoping for if W21 is "" ?
Does it help to know that
= 100 + N(W21)
would treat "" as 0.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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