?
Solved

MS Excel Query

Posted on 2012-04-10
7
Medium Priority
?
465 Views
Last Modified: 2012-04-12
Hi All,

I am trying to combine 3 columns into 1. I have a column for First Name, Last Name and Middle initial.  My combined cloumn is: Last Name+', '+First Name+' '+Middle initial.

The problem is, if the person does not have a middle initial then nothing is shown.

How do I get My combined column to reflect the Last Name and First name only if no middle initial is present.

Thank you in advance.
0
Comment
Question by:Reyesrj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 1000 total points
ID: 37826538
Let's say, column A stores Last name,  column B stores first name and column C stores middle intial, and the final combined results stored in column D:

Formula in column D:
=A1 & ", " & B1 & IF(C1 <> "",  " " & C1, "")
0
 

Author Comment

by:Reyesrj
ID: 37826628
Thanks, but that's in the spreadsheet.  How do I combine the columns in MS Excel database query?
0
 
LVL 9

Assisted Solution

by:Anthony Mellor
Anthony Mellor earned 1000 total points
ID: 37834717
what's the external data file type and source? are you on a pc or mac ? which version excel?

any chance a small data example? easier to play with. edit how big is the data source, hundreds thousands or millions of records? this problem sounds familiar.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Reyesrj
ID: 37835574
Currently there are about 600 records in Access 2007.  It is anticipated to increase by 100 per week.  I experience this all time.  It’s that blank or NULL field that creates the problem.  What I have done in the past is combine the first name and last name into one column and leave the middle initial in a separate column.   Then combine the combined name column with the middle initial column in the excel table.
Thanks

Sample pic
0
 

Author Comment

by:Reyesrj
ID: 37835623
Sorry, the pic was for my other question.
0
 

Author Closing Comment

by:Reyesrj
ID: 37835863
This is what I found:

In MS Excel Database Query Wizard, you use ampersand "&" instead of a plus sign "+".  So the formula would look like this:

LastName & ', ' & FirstName & ' ' & MiddleName

Thanks to ALL
0
 
LVL 9

Expert Comment

by:Anthony Mellor
ID: 37836333
thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question