Microsoft Excel - Lookup through 5 columns and return the value in the 6th column

Asked By Troy
01-Nov-10 10:37 AM

I am trying to simplify looking up wireless/cellular numbers across multiple vendors and we have about 30,000 wireless numbers total (cell phones, PDA and air cards), and need to cross reference eligibility dates against the wireless number.  Our customers are not consistant in how they enter their wireless number, so I expanded each to fit the 5 most common customer entries, so the wireless number of (111-222-3333) would be in each spreadsheet (AT&T, VZW etc) as 111-222-3333 (column A), 111 222 3333 (column B), 111.222.3333 (column C), 1112223333 (column D), (111) 222-3333 (column E).  Column F holds the date/vaue of when the number will be eligible for an upgrade.  I need to use an EXACT match, otherwise it could return a number that is not in our list.  With 30,000 rows of wireless numbers and 18 columns of information (wireless number, electronic serial number, contract start date, SIM number etc), stacking the information end to end as a single column for Vlookup would be a bit unweildly.

So I am attampting to have Sheet 1 as the front page to enter the wireless number and the rest of the sheets as data tabs (AT&T (sheet 2), VZW (sheet 3), SPrint/Nextel (sheet 4) etc).

Sheet 1
Titles -    (A1) Wireless Number      (B1) Eligibility Date    (C1) Customer Name  (D1) Vendor Name
Results - (A2) Enter wireless # here     (B2) Value from Col F  (C2) Value from Col G  (D2) Value from Col H

Sheet 2 (AT&T)

Service Number Service Number Service Number Service Number Service Number Upgrade Eligibility Service Name Vendor Name
201-253-7860 201 253 7860 201.253.7860 2012537860 (201) 253-7860 10/12/2010 Jane Doe AT&T Mobile
201-253-8105 201 253 8105 201.253.8105 2012538105 (201) 253-8105 10/12/2010 John Doe AT&T Mobile

I don't mind if I have to have Row 2 for AT&T, Row 3 for VZW and Row 4 for Sprint/Nextel, as long as I can get the results on the same page with a single Lookup_Value from Cell A2.  I've tried doing this many ways and one was semi-successful, but I know there has to be a better way.  Is there a command similar to VLookup that will search an entire Table Array for a match to A2 versus trying to be clever with several VLookup formulas?

Thank you in advance for your help.

Troy

  Rolf Jaeger replied to Troy
01-Nov-10 10:38 AM
Hi Troy:

the text of your post seems truncated on the right side. Therefore I have been unable to follow what you would like to accomplish with your worksheet.

Best wishes,
Rolf
  Troy replied to Rolf Jaeger
01-Nov-10 11:30 AM

Thank you for the prompt reply Rolf!

 

I saw that error once I posted and was in the process of whittling down the fluff info to make it fit.  I had to replace the XL text with plain text.  The Sheet 2 example refused to line up so I had to use hyphens as spacers to keep it clear.

 

I am trying to simplify looking up wireless/cellular numbers across multiple vendors and we have about 26,000 wireless numbers total (cell phones, PDA and air cards), and need to cross reference eligibility dates against the wireless number.  Our customers are not consistant in how they enter their wireless number, so I expanded each to fit the 5 most common customer entries, so the wireless number of (111-222-3333) would be in each spreadsheet (AT&T, VZW etc) as 111-222-3333 (column A), 111 222 3333 (column B), 111.222.3333 (column C), 1112223333 (column D), (111) 222-3333 (column E).  Column F holds the date/vaue of when the number will be eligible for an upgrade.  I need to use an EXACT match, otherwise it could return a number that is not in our list.  With 26,000 rows of wireless numbers and 18 columns of information (wireless number, electronic serial number, contract start date, SIM number etc), stacking the information end to end as a single column for Vlookup would be a bit unweildly.

 

So I am attampting to have Sheet 1 as the front page to enter the wireless number and the rest of the sheets as data tabs (AT&T (sheet 2), VZW (sheet 3), SPrint/Nextel (sheet 4) etc).  I'll enter the wireless number that I am validating into cell A2, and have formulas populate the eligibility date in B2, customer name in C2 and vendor name in D2.

 

Sheet 1

Titles- (A1) Wireless Number     (B1) Eligibility Date (C1) Customer Name    (D1) Vendor Name

Results-(A2) Enter wireless #    (B2) Value from Col F (C2) Value from Col G (D2) Value from Col H

 

Sheet 2 (AT&T) - about 16,000 rows - Sheet 3 (VZW) about 8,000 rows - Sheet 4 (Sprint/Nextel)

Number---------Number---------Number---------Number-------Number-----------Upgrade------Name--Vendor

201-253-7860 | 201 253 7860 | 201.253.7860 | 2012537860 | (201) 253-7860 | 10/12/2010 | Jane |AT&T

201-253-8105 | 201 253 8105 | 201.253.8105 | 2012538105 | (201) 253-8105 | 10/12/2010 | John |AT&T

 

I don't mind if I have to have Row 2 for AT&T, Row 3 for VZW and Row 4 for Sprint/Nextel, as long as I can get the results on the same page with a single Lookup_Value from Cell A2.  I've tried doing this many ways and one was semi-successful, but I know there has to be a better way.  Is there a command similar to VLookup that will search an entire Table Array for a match to A2 versus trying to be clever with several VLookup formulas?

 

Thank you in advance for your help.

 

Troy

  Rolf Jaeger replied to Troy
01-Nov-10 12:28 PM
Hi Troy:

OK, now I can at least follow what you posted.

HOWEVER I am still having some major problems grasping what you are tyring to do. My biggest problem actually is that I can't believe that a company with tens of thousands of customers is struggling with the fact that customers enter their phone numbers in inconsistent ways. That's simply the fact of life, but there is a VERY SIMPLE fix for that: NORMALIZE THE ENTRIES,e.g. by using code listed below. As you will see that code rejects any character that is not numeric. Trying to work with all variants of customer data entry simply is a waste of time and storage.

Hopefully having made that point sufficiently clear I am willing to assume that you might have to live with a database that was created without the benefit of this suggestion and will try to assist you with this dilemma. In order for me to have a chance you will however clarify a few specifics of your workbook structure:

1) in the first paragraph of your problem description you are explicitly referring to columns A through E as holding variants of the phone numbers for each of the service providers. When you are describing the layout of Sheet1 you are however referring to columns F through H as source for cells B2 through D2...?

2) I don't understand what you mean by 'Enter wireless # in cell A2 of the 'Results' row on Sheet1. Who enters the number? Would it be possible to make sure that that entry gets normalized? If that's possible you only would have to look up ColumnD and you would be home free.

It would probably be best if you were to try to post a SPECIFIC example of what you would like to see on Sheet1.

Looking forward to your response,
Rolf

Function NormalizedPhoneNumber(r As Range) as String
  'This function eliminates all non-numerals from a given string
  Dim i As Integer
  Dim n As String
  For i = 1 To Len(r.Value)
    If IsNumeric(Mid(r.Value, i, 1)) Then n = n & Mid(r.Value, i, 1)
  Next i
  NormalizedPhoneNumber = n
End Function


Lookin forward
  Troy replied to Rolf Jaeger
01-Nov-10 02:18 PM

Rolf,

 

If that coding will remove any non-integer so that any number pasted into a cell will return a straight 10 digit phone number, that would make my life much simpler.  from there I could easily do VLookup commands to return the answer.  I am not versed in VBA or Macros though, but I am technically saavy and can usually figure things out once pointed in the right direction.

 

I tried to avoid the unabridged story, but to answer your question on how a company this big can have so many customers and not have this figured out...I work for the government.  The previous presidential administration thought it would be a good idea to outsource the IT work, and it has forced us to create different teams to work with people both inside and outside the government.  Without saying who exactly, I can say we have several locations and I spent about a year replacing stand alone contracts and wireless devices with devices on a single, enterprise contract.  We now have better service, a larger pool of minutes to pull from, and it's better for us as government employees and cheaper for the taxpayers (I'm big on that last part).  This was done with a team of people who worked wireless every day and were in constant communication with the vendors, thus we had an ordering form that was created to be used by people that knew wireless inside and out.  Once the devices had been replaced and the team disbanded, customers that needed new or replacement cell phones needed a way to order them, and the same ordering form was passed out.  Needless to say it wasn't easily understood by the common customer.  We noticed repetitive errors so my bosses boss asked if someone would volunteer to create a customer friendly ordering form for wireless, and with my background, I volunteered.  Now almost every customer question has answers via comments when people take the time to read them, and ordering has become pretty simple for both the customer and tech.  However, I didn't have the XL knowledge in the past to normalize the numbers.  I'd prefer to do this now on the spreadsheet I'm trying to build because it will be used by about 40 people, versus about 50,000 govnerment customers.

 

Now that time has passed the wireless devices are starting to get old and fail and need replacement, so we need an efficient way to tell which wireless numbers are eligible for a free upgrade and which are not.  There are 3 teams that are heavily involved, the help center, the ordering team with contractual signing authority (for non-free upgrades) and the actual team that places the orders through the vendors.  The help desk is the lowest paid of the group (they follow scripts for everything), so it makes sense that they should do the menial tasks because it would be cheaper to the taxpayer overall.  Well, the help desk is supposed to send the free upgrades straight to the ordering team, but they don't often take the time to check and see if the number is eligible or not, so they almost always blindly forward every order to us unless the customer tells them they are eligible for a free upgrade.  I 'm trying to make it so easy that they will actually do the check before forwarding the request to the wrong team, plus all 3 teams need the information to be easily accessable.

 

If you're still awake, basically what I'm trying to do is copy the wireless number out of the trouble ticket or out of a wireless ordering form and paste it into a 2nd spreadsheet.  For namesake, we'll call the 2nd spreadsheet "Eligibility". 

 

On the Eligibility spreadsheet, I was going to have Tab A as the sheet where we (the technicians) paste the wireless number and the eligibility date, customer name and other results are displayed.  Tab B (and the rest) are data tabs containing a list of all of our AT&T wireless numbers and the date when the line became or will become eligible for a free upgrade, Tab C is a list of all of our VZW wireless numbers and the date when the line became or will become eligible for a free upgrade etc.  The example below  will be Tab A of the Eligiblity spreadsheet.  Row 1 will just be titles for reference, and Row 2 will be used to input the wireless number (Cell A2).  Using the number in cell A2 as a reference, and I'd like to have the results returned in cell B2 for the eligibility date, cell C2 for the customer name, and cell D2 for the vendor name.  If it would be easier, I could just return the AT&T information in row 2, the VZW information in row 3 and so forth. Then I'll do some conditional formatting on the date returned so it will be green or red, based on the eligibility date.   If I can get your script to work, I can condense those 5 wireless number columns back into a single column.  I receive the full database from a coworker and I can manipulate it however I need to make it work. 

 

Sheet 1 example

Titles  - (A1) Wireless Number     (B1) Eligibility Date (C1) Customer Name    (D1) Vendor Name

Results - (A2) Enter wireless #    (B2) Value from Col F (C2) Value from Col G (D2) Value from Col H

 

Could you tell me also how to make that script work?  I have the Developer tab turned on already.

 

Lastly, I see several of the members that answer questions get paid in some manner.  I've put plenty of time into this, on the clock and personal time both, and would like to compensate you for your time and answer if I can make this work.  How would I go about doing this?

 

If it would be easier I could e-mail you a copy of what I'm working with so you can see it 100%.

  wally eye replied to Troy
02-Nov-10 01:10 PM
I had a match function that was working nicely, but I like Rolf's better.  There was a bit of a trick to get it to work as a User Defined Function, I found a good reference at:

http://blogs.msdn.com/b/frice/archive/2004/06/11/153891.aspx
  Troy replied to wally eye
02-Nov-10 03:47 PM
Thanks Wally Eye!   I was actually able to get Rolf's VB programing to work and do pretty much everything I needed by normal Excel formulas, but that link has some great information!  I saved it into my favorites with my other Excel links.   When I was adding Rolf's programming I found more programming that someone had added when my spreadsheet was originally reviewed by our management that had nearly 300 lines and would pull the users information from Active Directory (Exchange e-mail profile information).  At least I have an expert that I can shoot occassional questions to.  If they can pull this information from A.D., this problem would have been pretty simple I bet.  Shame on them for leaving their names in the programming remarks!
  Troy replied to Troy
02-Nov-10 04:02 PM
Repost for Rolf's sake...

Lastly, I see several of the members that answer questions get paid in some manner.  I've put plenty of time into this, on the clock and personal time both, and would like to compensate you for your time and answer if I can make this work (which I did).  How would I go about doing this?

I was going insane trying to figure this out...without your help, I'd have jumped out of a window.  OK, it was a first story window, but still...  :)
  Rolf Jaeger replied to Troy
02-Nov-10 07:58 PM
Hi Troy:

first off, and most importantly, I am glad you found a solution, and better yet it seems one that utilized my suggestion. I do appreciate your taking the time to explain (it was interesting reading!) and thanks for trying to save our taxpayer's money!!!

I do appreciate your offer to compensate me for the time I put into this (although the time I spend here is predominantly intended to be pro bono, but who in their right minds would reject even a small donation, so thanks in advance!). If you are really serious you can find a donation link on my web page:

http://soarentcomputing.com/SoarentComputing/ExcelSolutions/pAutomatingExcel.html

Please contact me at office@soarentcomputing.com if you encounter problems with that link.

Once again, best wishes, and keep up the good work,
Rolf
  Troy replied to Rolf Jaeger
10-Nov-10 05:44 PM

Thanks Rolf,

 

I sent the link home to my wife and I'll ask her to use her paypal account to send the well deserved money your way.  She is getting off of work now and will be home to take care of this shortly.

 

Your short and simple VB programming removed a headache that I was not able to use typical formula's and cleverness to circumvent, and solved 99% of my task.  After I finish with the paypal, I'll hit you with another little issue that you can probably easily solve.  I'll e-mail you a short copy of the actual spreadsheet so you can see exactly what I'm doing, but I'll explain below for anyone that may be following this thread.

 

-------------------------------------------------------

Short question - (long and painful description follows).  I have information that will more or less randomly fill in ONLY a single cell, either A1, B1 or C1, and the 2 remaining cells that are not filled will return the value of "#N/A" because they are VLOOKUP formula's that don't return a value.  How can I concatenate A1, B1 and C1 into a single value/single cell when two of them are "#N/A" and one value will be a date value (or text name)?

-------------------------------------------------------

 

Long and painful description:

For the sake of simplicity, let's say there are 4 tabs.  Tabs 2, 3 and 4 are data tabs (AT&T, Verizon Wireless and Sprint) with phone numbers, eligibility dates, customer names and vendor names.  Tab 1 is the interface tab and will have 3 columns and 5 rows.  Row 1 will be where you enter the wireless number that you need to look up from the data tabs 2, 3 and 4, so cell A1 says "enter wireless number here", with an arrow pointing to the cell on the right (Cell B1) for the directionally challenged idiots.  Cell C1 is where I referenced your VB programming that returns only the 10 numbers entered in cell B1.  Row 2 will be titles-Column A "Eligibility Date", Column B "Customer Name" and Column C "Vendor Name". 

 

Row 3  references the AT&T data tab 2 and has the formula "=VLOOKUP(VALUE($C$1),'AT&T OCT 2010'!$A$2:$E$16613,2,FALSE)" and the "2" in the col_index_num portion of the formula returns the "Eligibility Date", "3" returns the "Customer Name" and "4" returns the "Vendor Name" reference. 

 

Row 4 is the same as above, but references the VZW data tab 3.

Row 5 is the same as above, but references the Sprint data tab 4.

 

I also use conditional formatting to color/fill the "Eligiblity Date" cell green or red, depending on the date value returned.  If the date is today or in the past, the fill color is green, and if the date is in the future (thus, not eligible for an upgrade) the fill color is red...and of course, I have the errors hidden to enhance people's viewing pleasure.

 

So, if I enter cellular number 918-555-1212 in cell B1, your formula returns 9185551212 in cell C1.  Let's say the number is an AT&T number and is eligible for an upgrade, so cell A3 would show the eligibility date of 1/26/2010 and the cell would be green.  Cell B3 would have the customer name "John Doe" and cell C3 would say "AT&T Mobile".  Since the number wasn't on the VZW or Sprint tab, rows 4 and 5 would remain blank. 

 

So basically, if the number is an AT&T number, it fills in Row 3, and row 4 & 5 are blank.  if the number belongs to VZW, the information fills on Row 4, and rows 3 & 5 are blank, and if the number belongs to Sprint, the information is fills in on Row 5, and rows 3 and 4 are blank.

 

Is there  way to put the information into a single row?  Concatenate and the "&" functions don't want to work, or I'm not doing something correctly.

 

Actually, I have had enough interruptions that my wife made it home and we made the paypal transaction a moment ago. :)

And I am now sending the actual spreadsheet to your e-mail with about 20 randomized numbers for an example.

EDIT:

Wow, I'm glad this posted...when I hit submit, my computer locked up so hard the mouse wouldn't move and the clock wouldn't change, and I didn't have a copy of all of this...(wiping brow)

  Rolf Jaeger replied to Troy
11-Nov-10 01:32 PM
Hi Troy:

if I correctly understand what you would like to do it should be RELATIVELY easy to do.
I'll look for your e-mail and get back to you hopefully before the end of the weekend.

Best wishes,
Rolf


  Rolf Jaeger replied to Troy
12-Nov-10 06:09 PM
Hi Troy:

I am impressed how far you have come along.

However I was initially dumbfounded that Excel's CONCATENATE function failed to help reducing your output line to one. I had to dig deep and came up with the following (much more complicated) formulae:

Cell A3:
=IF(ISNA(VLOOKUP(VALUE($C$1),'AT&T OCT 2010'!$A$2:$D$16613,2,FALSE)),IF(ISNA(VLOOKUP(VALUE($C$1),'VZW OCT 2010'!$A$2:$D$8805,2,FALSE)),VLOOKUP(VALUE($C$1),'Sprint July 2010 (both accts)'!$A$2:$D$878,2,FALSE),VLOOKUP(VALUE($C$1),'VZW OCT 2010'!$A$2:$D$8805,2,FALSE)),VLOOKUP(VALUE($C$1),'AT&T OCT 2010'!$A$2:$D$16613,2,FALSE))

Cell B3:
=IF(ISNA(VLOOKUP(VALUE($C$1),'AT&T OCT 2010'!$A$2:$D$16613,3,FALSE)),IF(ISNA(VLOOKUP(VALUE($C$1),'VZW OCT 2010'!$A$2:$D$8805,3,FALSE)),VLOOKUP(VALUE($C$1),'Sprint July 2010 (both accts)'!$A$2:$D$878,3,FALSE),VLOOKUP(VALUE($C$1),'VZW OCT 2010'!$A$2:$D$8805,3,FALSE)),VLOOKUP(VALUE($C$1),'AT&T OCT 2010'!$A$2:$D$16613,3,FALSE))

Cell C3:
=IF(ISNA(VLOOKUP(VALUE($C$1),'AT&T OCT 2010'!$A$2:$D$16613,4,FALSE)),IF(ISNA(VLOOKUP(VALUE($C$1),'VZW OCT 2010'!$A$2:$D$8805,4,FALSE)),VLOOKUP(VALUE($C$1),'Sprint July 2010 (both accts)'!$A$2:$D$878,4,FALSE),VLOOKUP(VALUE($C$1),'VZW OCT 2010'!$A$2:$D$8805,4,FALSE)),VLOOKUP(VALUE($C$1),'AT&T OCT 2010'!$A$2:$D$16613,4,FALSE))

Hope this helped,
Rolf
  Rolf Jaeger replied to Rolf Jaeger
13-Nov-10 11:21 AM
Hi Troy:

I realized that the reason you and I couldn't get the CONCATENATE method to work is actually VERY simple: if any of the arguments in a CONCATENATE formula returns #N/A (as will be the case in the formula needed in your case) it will return #N/A. Of course in your particular worksheet that error doesn't show up as such, because of the conditional formatting rule you set for that condition. So there really seems to be no other way than the approach I have chosen in which one checks whether any of the arguments returns #N/A.

Best wishes,
Rolf
Create New Account
help
Microsoft Active Directory Monitoring Windows Server Hi, I have the following requirement to write a Microsoft Active Directory programming - Real Time / Near Real time Microsoft Active Directory changes detection - Need to find out who the perpetrator / user that caused the change
Microsoft Active Directory Authentication Windows Server Subject Microsoft Active Directory: I have 2003 Active Directory (2003 Functional level) environment with 60 domain controllers in a Hub and Spoke replication topology
Active Directory Authentication This article will help in developing and understanding basic Active Directory Authentication System. The attached source code will authenticate user against his login credentials in the selected domain. Active Directory Authentication Click here to download the source code Introduction Authenticate users accessing application by using Microsoft Active Directory using Microsoft DirectoryServices. Background Security is one of the most important thing while developing
REMOVING Windows 2000 server Windows Server Current Setup: 1 Windows 2000 Standard Server with Active Directory, Active Directory Connector to Exchange NO OTHER KNOWN ROLLS 2 Windows 2003 Standard Server R2 with Active Directory 1) is also a Print and file server other is a 2) fax server 1 I turn off the 2000 Server the clients disconnect from the exchange server. I followed Microsoft's recommendations when I upgraded from Exchange 2000 to exchange server 2003 standard. I want the Exchange Server. One recommendation I had was to promote the Member server to a active directory server. I want to know the real path. I have ran the Microsoft Best
Books on Windows 2003 Server Active Directory Windows Server Any recommendations on some of the best books to buy for learning / fixing issues in Active Directory. (2003) Active Directory Cookbook Active Directory both by Robbie Allen. Are they any good. Thanks, Windows Server Active Directory Discussions Active