Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Excel formula not working on all cells

Posted on 2014-02-23
8
Medium Priority
?
522 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 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

610 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