Solved

MS Excel formula not working on all cells

Posted on 2014-02-23
8
493 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
[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
  • 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:Naresh Patel
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:Naresh Patel
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

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

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