SQL and Excel?

DCypher

Senior member
Oct 8, 2004
320
0
0
Ok, anandtech, heres the deal. I have an excel column full of alphanumeric ID's. These people have email addresses that correspond to their ID. For example if the ID is bob5, the email address is bob5@john.com. What I want to do is email all of these ID's, first by extracting them and adding @john.com on the end, and then outputting them (probably in a .txt or .doc) and putting them in email format so that I can copy/paste it in the TO: box.

Example:

bob4@john.com; ghu7@john.com; hty3@john.com

I would appreciate any advice, should I use SQL somehow? Thanks everyone.
 

Jeraden

Platinum Member
Oct 9, 1999
2,518
1
76
well, if you just want to suffix them all with @john.com

If the email is in column A of an excel file, in column B just put the formula =concatenate(a1,"@john.com;") then copy that all the way down. Now column B will have the full email address. Now you can copy the contents of those cells and put it into your mail program, though everything will show up on a separate line, but that should be ok depending on your mailer.
 

DCypher

Senior member
Oct 8, 2004
320
0
0
Wow, you rock, thats exactly what I wanted. Thank you so much.

Just for some futher interest, is there a way to extract data from an excel document using SQL?

Thanks again for the help.

 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: DCypher
Just for some futher interest, is there a way to extract data from an excel document using SQL?
I think you're misunderstanding what SQL is. SQL is basically a way for applications to talk to a database (on an SQL server). Excel is one such application - it can query an SQL server to get information for its cells. But Excel is not itself a database, it's a spreadsheet - it doesn't make sense to "use SQL on an Excel document".

 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
You could import your spreadsheet into an Access database, then use SQL to extract specific data out of it. But you cannot use SQL directly on an Excel spreadsheet.