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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

MagiCat

Board Regular
Joined
May 24, 2006
Messages
121
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.
 

gators

New Member
Joined
Jul 28, 2006
Messages
24
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
 

tianimo

New Member
Joined
Sep 29, 2006
Messages
9
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.
 

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,010
Office Version
  1. 365

ADVERTISEMENT

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?
 

MagiCat

Board Regular
Joined
May 24, 2006
Messages
121
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.
 

Forum statistics

Threads
1,136,349
Messages
5,675,244
Members
419,557
Latest member
razlevav

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
Top