Solved

MS Excel formula not working on all cells

Posted on 2014-02-23
8
473 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 8

Expert Comment

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


Thanks  :)
0
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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