conditional statement

gators

New Member
Joined
Jul 28, 2006
Messages
24
Need help with a conditional statement. If the cell is not null then concatenate the three else just use the one column.


I have three cells
A B C

IF A IS not NULL Then D = A & B & C
Else
D = A
END IF

I tried this IF(A1<>"",A1 & B1 & C1, A1)
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I'm assuming you mean that A1 is blank by this.

I'd do it like this:

=if(trim(len(a1) = 0), a1 & b1 & c1, "")

No need for D = A if you already know that A is blank.

The trim is to get rid of the potential for spaces without any content.
 
Upvote 0
Perhaps im doing something wrong but when I put the formula into D1
nothing happens. I know it maybe a super newbie issue. But i just don't know
 
Upvote 0
You could try using CONCATENATE in the "value if true" section of your formula.

=IF(A1<>"",CONCATENATE(B1,C1,D1),"")

Either way it should work, but worth seeing if it makes a difference.
 
Upvote 0
Perhaps im doing something wrong but when I put the formula into D1
nothing happens. I know it maybe a super newbie issue. But i just don't know

What are the current values in A1, B1, and C1?
 
Upvote 0
Could it be that you're not putting the = sign before the formula? Either that or you have the field formatted as text, that stops formulas from evaluating for me.
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,947
Members
448,534
Latest member
benefuexx

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