Excel 2003: =IF function

Hi EE,

I have to "merge" the data from 2 columns   D2   AND E2  into one column   F2.

If D2 has data, populate F2 with D2's data,  else use E2's data.


In a new column called  F2 have this formula:
     =IF(D2<>" ",D2,E2)


Problem is , if D2 is blank, it's populating F2 with a 0 instead of the data from E2.

Below uploaded a sample...

Thx so much for your help, sandra
EE-ClassGroupings4.xls
mytfeinAsked:
Who is Participating?
 
StephenJRConnect With a Mentor Commented:
If either D or E will always be full

=IF(D2<>"",D2,E2)
0
 
telyni19Connect With a Mentor Commented:
If D3 can be empty but shouldn't be just a space, try this one:
=IF(LEN(D3)>0,D3,E3)
0
 
Patrick MatthewsConnect With a Mentor Commented:
This accommodates blanks or all spaces, and prevents a 0 result if both D and E are blank:

=if(trim(d2)<>"",d2,e2&"")
0
 
theKashyapConnect With a Mentor Commented:
If D3 can also contain just space(s) then use:
=IF(TRIM(D2)<>"",D2,E2)
or
=IF(LEN(TRIM(D3))>0,D3,E3)

Also see the CLEAN function if applicable.
0
 
mytfeinAuthor Commented:
Hi Everyone,

Thx so much for writing....

Your ideas solved my problem.... The ideas were similar and yet different....

Below is xls with columns using each of your ideas.....

I learned that:

a)   testing for " "   is different than testing for ""  - if blank, i have to test for ""
b)   can use TRIM, LEN functions
c)   to make a column really blank, append a " " at the end

tx again, s

EE-ClassGroupings4.xls
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.