When is a blank cell not a blank cell

warriorwoman

New Member
Joined
Mar 18, 2010
Messages
22
I have a load of what I consider to be blank cells but excel isblank() function returns the value false.
There are no spaces in the cell but if I place the cursor in the cell then press F2 to edit and then enter the isblank() function returns True.

Can anyone explain?

I am trying to write a macro that will overwrite the values in column A where the values in column C = "CQUIN" or "U CODE". I was going to handle this in a clunky fashion by:

1. creating in new column D with the formula =IF(OR(C3="CQUIN","U CODE"),C3,"")

2. copy then paste as values column D - thereby hopefully leaving myself with a load of blank cells and ones with CQUIN or U Code in.

3. then selecting column D and paste special as values - skipping blanks over column A

Unfortunately this isn't working as it doesn't regnise the blank cells.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hello

That cell is no longer considered blank because it was occupied by a formula that returned "". To fix this, after you have copied over a values, select the column and invoke Text to Columns (in Data menu or Data tab depening on your XL version).

In Text to Columns Wizard choose Delimited in step1.
In step 2 clear all delimiters
Then hit finish.
To check that the blanks are now indeed blank, with the same column selected, hit F5 > Special > Blanks > Ok. Only those blank cells should remain selected.

The selection should now be ready for paste (with skip blanks checked).
 
Upvote 0
Looking back at your formula I think you should be using:

=IF(OR(C3={"CQUIN","U CODE"}),C3,"")

But I think you can simplify by one step with:

=IF(OR(C3={"CQUIN","U CODE"}),C3,NA())

Next, select column D.
Hit F5 > Special > Formulas and leave only Errors checked
This should leave only the #N/A's selected.
Hit the Delete key.

Now select the data in column D again > copy, go across to column A, paste special > Values + Skip Blanks.
 
Upvote 0
Strange that the curly brackets don't work. What do you mean when you say they don't work? Does it pop up with an error or not return the expected result?

Alternatively:

=IF(OR(C3="CQUIN",C3="U CODE"),C3,NA())

But this construct won't return correct results:
=IF(OR(C3="CQUIN","U CODE"),C3,NA())
...as "U CODE" is not being considered as part of the OR evaluation against C3.
 
Upvote 0
This illustrates the results of the different ways. I'm afraid I don't see how your initial method could work:
Excel Workbook
CDEF
1VALSFormula1Formula2Formula3
2CQUINCQUINCQUIN#VALUE!
3U CODEU CODEU CODE#VALUE!
4SOMETHING ELSE#N/A#N/A#VALUE!
sheet
Excel 2003
Cell Formulas
RangeFormula
D2=IF(OR(C2={"CQUIN","U CODE"}),C2,NA())
E2=IF(OR(C2="CQUIN",C2="U CODE"),C2,NA())
F2=IF(OR(C2="CQUIN","U CODE"),C2,"")
 
Upvote 0
Oh I'm sorry I wrote it out incorrectly in the first example, I was actually using the following expression

=IF(OR(C3="CQUIN",C3="U CODE"),C3,"")

I'll retry the curly brackets expression as you've clearly got it working ok in your example below.

Thanks for your time.
 
Upvote 0
If it's something you're going to be doing repeatedly in the long run, would using LEN()=0 be more helpful than ISBLANK()?

That'll return a true on cells that are filled with "" unlike ISBLANK
 
Upvote 0

Forum statistics

Threads
1,216,129
Messages
6,129,046
Members
449,482
Latest member
al mugheen

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