Solved

Need help with index/match exchange formula

Posted on 2011-02-17
4
330 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
[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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

705 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