Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

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
0
mytfein
Asked:
mytfein
4 Solutions
 
StephenJRCommented:
If either D or E will always be full

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

=if(trim(d2)<>"",d2,e2&"")
0
 
theKashyapCommented:
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now