Solved

Need help with index/match exchange formula

Posted on 2011-02-17
4
288 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now