Solved

MS Excel formula not working on all cells

Posted on 2014-02-23
8
451 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 80

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 80

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 80

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 80

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
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…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
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.

757 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

21 Experts available now in Live!

Get 1:1 Help Now