How to Delete "Blank" Cells En Masse So They Are Truly Empty?

chasfh

Board Regular
Joined
Dec 10, 2014
Messages
64
Office Version
  1. 365
Platform
  1. Windows
I have come across a problem in which I want the "then" part of a formula to be completely empty.

Here's an example of what I mean. The actual formula here is not important—just the end part of it is:

=IFNA(XLOOKUP($DI2+(EE$5-1901),$G$4:$AK$4,$G1:$AK1),"")

The very end part of this formula is asking to make the cell "blank" if the cell referred to is NA. I may apply this formula to thousands of cells within an array. Afterwards, to make the worksheet nimble, I will copy/paste values so I still see the number that the formula wrought in the appropriate cells, without having to keep the formula in the cell. Any cells without data in them will be "blank". Or at least look empty.

The problem is, any cell I ask to be made blank is not truly empty, but instead has an apostrophe, quote mark, or caret in the cell (depending on cell alignment).

This is fine as far as dependent calculations on the cell are concerned, but the problem comes when I am trying to sort a column of a few thousand rows that has a few hundred of these "blank" cells in them. The sort function reads these cells as being numerically higher than any cell with an actual number in it, so when sorting Z-A, they end up at the top of the column, which creates an obvious problem.

If I can change the status of the cells en masse from "blank" to empty, that will solve the sort problem, but I have not yet found a simple way to do this en masse. The Find and Replace function (CTRL+H) doesn't help because when I try to find any of these "blank" cells, by pressing the space bar in the Find field, the function returns "We couldn't find anything to replace." Obviously, searching for ', ", or ^ doesn't work. And of course, not pressing the space bar in the Find field doesn't even trigger any recognition by the function that I'm trying to use it.

Does anyone recognize this problem and can help? I know I can just go to a "blank" cell, click delete, and that will empty the cell, but I don't want to have to manually find and select every "blank"cell so I can do that. I would rather select an entire array of cells that has both data and "blank" cells in them, and empty out just the blank cells.
 
Last edited:

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
As @MARK858 pointed out the only way you can do that is with a macro.
If you are happy to select the area first then running this macro will fix it.

VBA Code:
Sub ConvertFormulasToValues()

    Selection.Value = Selection.Value

End Sub

Is this a code for converting formulas into values, or is this a code for emptying out so-called "blank" cells that have only an alignment character like ', ", or ^ in it?
 
Upvote 0
It converts formulas to values but leaves the cell truly blank when there is a "" unlike Copy/Paste Values
 
Upvote 0
It converts formulas to values but leaves the cell truly blank when there is a "" unlike Copy/Paste Values

Great, I'll give it a shot, thanks.

Seems weird that Excel would not have such a basic function already provided in a button (which is essentially a macro) on one of the toolbars. But hey, that's why we hack ...
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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