Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Excel Query

Posted on 2012-04-10
7
Medium Priority
?
467 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

636 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