Solved

MS Excel formula not working on all cells

Posted on 2014-02-23
8
457 Views
Last Modified: 2014-02-23
I have a Excel file that I dump my credit card info into.

From that I have a column that has all the Category data or key words and the category description in the next column.  So that when a purchase of "McDonalds" or "Hungry Jacks" or "Pizza Hut" shows up the formula looks through the list and finds a match and automatically inputs "Eating Out" in the Category (Auto) column.

The problem I have is that it works for some cells but not others. Some lines return a value as they find a keyword, but others do not. Excel throws up a warning of a "Value not available error" but I cant see why it is doing this as its the same value as previous cells.

Can any one see why it is not working in some cells and let me know why please?

I have attached the file.
Spend.xlsx
0
Comment
Question by:cbpee
  • 4
  • 2
  • 2
8 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39881696
Your formula requires an exact match for the text in column B compared to the text in column G. If there is not an exact match, then #N/A! will be the result.

Your formula in cell F4 is a possible solution. I'd add a wildcard character at the end. In so doing, you can capture many more purchase categories:
=INDEX(H:H,MATCH(LEFT(B4,6) & "*",G:G,0))
0
 
LVL 8

Expert Comment

by:itjockey
ID: 39881700
Sir byundt,

may I have request you to explain how it works?   "*"!!!!

Thanks
0
 
LVL 81

Expert Comment

by:byundt
ID: 39881708
itjockey,
VLOOKUP, HLOOKUP and MATCH can all use the wildcard characters ? and *. The ? matches any single character, while * matches any combination (or none) of characters. Their behavior is like SUMIF, SUMIFS, COUNTIF and COUNTIFS in that respect.

In the suggested formula, we are looking for a match for the first 6 characters of cell B4. Anything at all may follow those 6 characters in column G and it would still be a match.

You might argue that 6 characters is not enough. That's a point worthy of discussion. You might also argue that we should try for an exact match first. That could happen with:
=INDEX(H:H,IFERROR(MATCH(B4,G:G,0),MATCH(LEFT(B4,6) & "*",G:G,0)))

Or if cbpee is using Excel 2010 or later, it is possible to use Microsoft's "Fuzzy Lookup Add-In for Excel" to do the matching: http://www.microsoft.com/en-us/download/details.aspx?id=15011

Brad
0
 
LVL 8

Expert Comment

by:itjockey
ID: 39881719
You not Brad You Are Brad Pitt...... Hero  !!!!!!


Thanks  :)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:cbpee
ID: 39881731
Hi All,

Wow amazing stuff, think I just learnt 4 hours in 2 minutes. Makes a lot more sense now that I see you put it that way.

Byundt - yes Excel 2013. Very interesting stuff, looks like a lot more reading with "Fuzzy Lookup Add in for Excel"
So is that why on line 10, when I just had "AIR" for "AIR LIQUIDE" it was not working as "AIR" was only 3 letters, and it needs 6 as a minimum?
0
 
LVL 81

Expert Comment

by:byundt
ID: 39881734
In the workbook you posted, there was nothing like Air Liquide in column G. So the formula is not going to find a match. But if you entered Air Liquide Alice Springs WA in column G, then you would find a match.
0
 
LVL 1

Author Closing Comment

by:cbpee
ID: 39881736
Lightning fast response with a spot on answer and solution for a fix.
0
 
LVL 81

Expert Comment

by:byundt
ID: 39881745
If you keep adding vendors to column G, the wildcard formula will find a higher proportion of matches in the future. In this respect, your workbook may be said to be "learning" from the mistakes that you keep correcting.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

919 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

12 Experts available now in Live!

Get 1:1 Help Now