Copy data into a cell

gullit

New Member
Joined
Jul 25, 2011
Messages
17
hi

I need help with this problem that i have.
I have a formula copied to a range of cells. it copies that content of one cell into a different cell. The problem is that if one of the cell is blank the formula returns an error message.

example:
i have data in cell A:5 throug D:5
i will copy data into A7 throug D7(contents of A5 goes into A7, b5 into B7,etc)

C5 empty - C7 i get an error

the formula that i use is
IF(A5=A5,A5,"")

Unless there is an different formula, this is the one i'm using
what formula can i use in case the content of a cell is blank (no data) it ignores the formula. I tried the COUNTA and ISNA formulas but does not work or what i'm doing wrong?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The formula works fine if the cell is blank. The only way I could make the formula fail for me is if there was an error value returned.

In which case you can use:

=IFERROR(IF(A5=A5,A5,""),"")

or if you have an older version of excel:

=IF(ISERROR(IF(A5=A5,A5,"")),"",IF(A5=A5,A5,""))
 
Upvote 0
The formula works fine if the cell is blank. The only way I could make the formula fail for me is if there was an error value returned.

In which case you can use:

=IFERROR(IF(A5=A5,A5,""),"")

or if you have an older version of excel:

=IF(ISERROR(IF(A5=A5,A5,"")),"",IF(A5=A5,A5,""))

I'm sorry, i don't get an error message. if the cell is blank what i get is "0", i guess since no data is present in the cell, excel asumes the data as 0. what i need is if cell is blank then the cell with the formula should be blank too. This is in case later on i need to insert data in the cell the formula will take effect.
Hope i'm making sense :(
 
Upvote 0
You are (or at least I think you are). :)

You just need to modify your IF statment.

Your Statement:
=IF(A5=A5,A5,"")

The problem with your statement is that A5=A5 will always be true true, so it is the same as just typing =A5

Modify your formula to this:

=IF(A5="","",A5)
 
Upvote 0
You are (or at least I think you are). :)

You just need to modify your IF statment.

Your Statement:
=IF(A5=A5,A5,"")

The problem with your statement is that A5=A5 will always be true true, so it is the same as just typing =A5

Modify your formula to this:

=IF(A5="","",A5)


thanks a lot!!!:). It does works.
I will never get tired of saying it....this forum Rocks:pray:
 
Upvote 0

Forum statistics

Threads
1,224,579
Messages
6,179,656
Members
452,934
Latest member
mm1t1

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