Formula to replace zero-length string

Haui

Board Regular
Joined
Apr 5, 2009
Messages
210
Hi, few sort of follow-up questions to this thread here: https://www.mrexcel.com/forum/excel...er-explanation-null-empty-nothing-solved.html

1) Is there a formula-solution (i.e. no VBA and no text to columns as I understand that solutions do exist with these tools) to convert a zero-length, non-blank string to a true empty cell, e.g. so that the isblank-function yiels TRUE for a cell which contains a fomula whose cell_reference is e.g. the following cell: =substitute([target_cell],[target_cell_contents],) (which is equivalent to: =substitute([target_cell],[target_cell_contents],"")?

2) How can such zero-length, non-blank string be used in Excel's FIND/FIND-REPLACE Functionm, not sure if possible at all as there's no UNICODE char or similar available for ""?

Thanks
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
No formula can convert another cell.

But I can say for example: =if([target_cell]="",[IF=TRUE]).

And if the target cell contains a zero-length string, i.e. evaluates to true. So then my question is: what needs to go into the [IF_TRUE] argument to create a cell-result where the ISBLANK-function evaluates to TRUE?

btw - re your other points that you prefer ="" instead of ISBLANK is exactly part of my question as both formulas produce DIFFERENT results for a truly empty cell vs. a zero-length non-blank cell.
A similar point is highlighted in my above link pointing out the inconsistent behaviour of ISBLANK vs. e.g. COUNTBLANK. The same reasoning applies to your formula.

Thanks
 
Upvote 0
If you have a formula in a cell then ISBLANK will return false, there is no way round that, that I know of.
 
Upvote 0
Its just the way the application works. For me ISBLANK is inconsistent insofar that if i was unaware of the presence of the formula, or even a paste special values of that formula, it would produce an erroneous result. For that reason i dont use it.
 
Upvote 0
If you have a formula in a cell then ISBLANK will return false, there is no way round that, that I know of.

If there is a formula in a cell, then the cell isn't blank. (It has a formula in it)
 
Last edited:
Upvote 0
If i use ="" then paste special values over that cell ISBLANK sees something that i dont and produces FALSE. Yet a blank cell that ISBLANK produces TRUE is equal to my cell. Logically for me that is nonsense. For that reason i avoid its use.
 
Upvote 0
If there is a formula in a cell, then the cell isn't blank. (It has a formula in it)

That point I sort of understand, however: If I paste the cell contents of ="" into a new cell, both cells yield FALSE if I use ISBLANK().
However, if I go into the cell where ="" was pasted into with F2 and then press enter, ISBLANK() evalutes to TRUE.

Why is that then?
 
Upvote 0
That point I sort of understand, however: If I paste the cell contents of ="" into a new cell, both cells yield FALSE if I use ISBLANK().
However, if I go into the cell where ="" was pasted into with F2 and then press enter, ISBLANK() evalutes to TRUE.

Why is that then?
Don't look at the .Value property of the cell, look at the .Formula property of the cell

The worksheet formula =ISBLANK(A1) returns the same as [VBA] Range("A1").Formula = vbNullString
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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