Solved

Need help with index/match exchange formula

Posted on 2011-02-17
4
313 Views
Last Modified: 2012-06-27
We have two spreadsheets on our company's network.  One is used by the sales department to record order information.  Another is used by the engineering department to coordinate builds.

In the engineering spreadsheet, there is an INDEX/MATCH formula that would look up the order number in the sales spreadsheet, and return the promised testing date.  If it could not find the order number, it would return a "-".  The problem is that sometimes the sales department will enter multiple orders for a single customer on a line if they're placed and scheduled for testing on the same day.  The index/match formula was not picking those up properly.  

I changed to formula a bit to include wildcards on either side of the order number so that it would simply check to see if the order number was present inside the cell at all.  Now, unfortunately, the formula returns the date except when the cell contains JUST the order number (IE, if searching for order number 12345, the formula will return the date if it finds "12345 & 12346" in the cell, but not if it finds just "12345" alone).

This is the formula:

=IF(ISBLANK(B2),"-",IF(ISNA(INDEX('\\YDS\public\Robot\[Current Master.xls]Schedule'!$A$1:$J$200,MATCH("*"&B2&"*",'\\YDS\public\Robot\[Current Master.xls]Schedule'!$I$1:$I$65536,0),1)),"-",INDEX('\\YDS\public\Robot\[Current Master.xls]Schedule'!$A$1:$J$200,MATCH("*"&B2&"*",'\\YDS\public\Robot\[Current Master.xls]Schedule'!$I$1:$I$65536,0),1)))

If anyone can give me some hints, that would be great.
0
Comment
Question by:Jason_Place
4 Comments
 
LVL 6

Expert Comment

by:KnutsonBM
ID: 34917777
could you post a copy of the spreadsheets by any chance?
0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 200 total points
ID: 34918056
Hello Jason,

If the result should be a date then try this version. It tries to MATCH C2 both with and without wildcards (precedence given to without)

=LOOKUP(99^9,IF({1,0},0,INDEX('\\YDS\public\Robot\[Current Master.xls]Schedule'!$A$1:$A$200,LOOKUP(99^9,MATCH(IF({1,0},"*"&C2&"*",C2),'\\YDS\public\Robot\[Current Master.xls]Schedule'!$I$1:$I$200,0)))))

If there is no match or B2 is blank the formula should return a zero, format the formula cell with this custom format

m/d/yyyy;;-

which will format the zeroes to display as dashes

regards, barry
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 300 total points
ID: 34918075
I think your wildcards are converting to text so it won't match a stored number. Try:

=IF(ISBLANK(B2),"-",IF(ISNA(MATCH(B2,'\\YDS\public\Robot\[Current Master.xls]Schedule'!$I$1:$I$65536,0)),IF(ISNA(MATCH("*"&B2&"*",'\\YDS\public\Robot\[Current Master.xls]Schedule'!$I$1:$I$65536,0)),"-",INDEX('\\YDS\public\Robot\[Current Master.xls]Schedule'!$A$1:$J$200,MATCH("*"&B2&"*",'\\YDS\public\Robot\[Current Master.xls]Schedule'!$I$1:$I$65536,0),1)),INDEX('\\YDS\public\Robot\[Current Master.xls]Schedule'!$A$1:$J$200,MATCH(B2,'\\YDS\public\Robot\[Current Master.xls]Schedule'!$I$1:$I$65536,0),1))

Hopefully I got the commas in the right place!
0
 
LVL 1

Author Closing Comment

by:Jason_Place
ID: 34918141
Good calls.  Both formulas worked.  Ended up using the second one so I wouldn't have to worry about format.  Thanks guys!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

803 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