If function with text value

G

Guest

I am trying to copy one cell to another with a if function. And if there is
nothing in the cell, I would like the other cell to be blank. I have tried
using this formula, but it gives me a #value error message.

Example:

A1=name
B1=name

My Formula: if(A1=" "," ",A1)
 
P

Peo Sjoblom

=IF(A1="","",A1)

if you use the result of the formula in a calculation don't use it like

=A1+C2

use

=SUM(A1,C2)


that will ignore text and not return value errors


--


Regards,


Peo Sjoblom
 
G

Gord Dibben

In B1 enter =IF(A1="","",A1)

Note: don't use spaces between the double quotes unless you are looking for a
space.

But in your case you should not have gotten a #value error if you are entering
the formula in B1.


Gord Dibben MS Excel MVP
 
F

Fred Smith

If there's nothing in the cell, and you want the result to be nothing, you don't
have to test for it. Just copy it. In B1, put:

=a1
 
D

David Biddulph

I'm confused, Fred, and I expect the OP will be too.
If A1 is empty and I put =A1 in B1, then in B1 I get a zero, which isn't
what I think the OP wants.
I think she needs =IF(A1="","",A1), as others have suggested.
 
F

Fred Smith

You're right. To my simple mind, =if(a1="","",a1) is the same as =a1. But to
Excel, it's not. When a1 is blank, =a1 results in zero, not blank.
 
C

Carla Pemberton

I tried that formula and it just enters the text of the formula into the new
cell instead of the text of the original cell. WHat am I doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top