We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
Excel vlookup failing for no obvious reason!

I am intentionally not putting in a range_lookup value as I want it to return approximate match if it cannot find an exact match.
Function reads: "=vlookup(N8,$A:$M,N$3+1)
Row 8 = "if(iserror(N7/N6,"-",rounddown(N7/N6,2))
Row 3 = Month number (1 to 12)
This works in 11 of the 12 instances. But fails in month 12 (Col. N)
Now it gets a little more strange - if I amend the function to read: "=vlookup(N8,$A:$M,N$3+1,) - i.e. add in a final comma, then the function works in column N, but fails in all other months instead.
I have tried obvious things, over-typed numbers with hardcoded values, changed the N3+1 to read as "13" instead etc. etc. and nothing works other than adding in the final comma (or ",FALSE")
The lookup table runs: 0%, 60% then upwards in 5% increments. It appears to fail on ANY number which is below 65% - suggesting it isn't recognising the 60% as the nearest match.
I could change the function to read:
"=if(isna(vlookup(N8,$A:$M,N3+1,FALSE)),vlookup(N8,$A:$M,N3+1,TRUE),vlookup(N8,$A:$M,N3+1,FALSE))
To get around it, but it'll still bug the !!!!!! out of me!
Anyone got any ideas on what I'm missing here?!
Comments
-
a social life?All of my views are my own0
-
I thought the final comma was needed. If there is no argument after the comma Vlookup assumes that it's false.
HTH, Dave0 -
a social life?
Thanks for this helpful input. I look forward to my social life continuing once I finish my day at work.I thought the final comma was needed. If there is no argument after the comma Vlookup assumes that it's false.
HTH, Dave
Thanks, but I think it's the opposite way around, and that by placing the final comma it assume false, but if it is omitted then Excel treats as both true and false (i.e. searches for an exact but if it can't find it it would do nearest)?"We can all fly as high as the dreams we dare to live...........unless we are a chicken" ~ Anon.0 -
Thanks, but I think it's the opposite way around, and that by placing the final comma it assume false, but if it is omitted then Excel treats as both true and false (i.e. searches for an exact but if it can't find it it would do nearest)?
According to Excel 2010:
Range_lookup: is a logical value: to find the closest match in the first column (sorted in ascending order) = TRUE or omitted; find an exact match = FALSE
Without being able to see some data and the formula with its problem, it is difficult. What version of Excel are you using and can you provide a more detailed example?I’m a Forum Ambassador and I support the Forum Team on the In My Home MoneySaving, Energy and Techie Stuff boards. If you need any help on these boards, do let me know. Please note that Ambassadors are not moderators. Any posts you spot in breach of the Forum Rules should be reported via the report button, or by emailing forumteam@moneysavingexpert.com.
All views are my own and not the official line of MoneySavingExpert.
0 -
Thanks Victor, that's basically what I meant but didn't word it well. With the comma excel appeared to treat this as a "false" statement (as it worked and returned the exact match), without the comma it was treating it as true (closest match - which could also be exact) - this created the error.
Have found the problem now anyway. The person who created the file containing the lookup table had done one of things which annoys me most in excel and entered a number in white font in a cell in column A which meant that excel was treating the dataset as not being in numerical order.
Changed that cell format to text and it now works, likewise changing the lookup_table from A:M to A3:M45 works.
Thanks for the help."We can all fly as high as the dreams we dare to live...........unless we are a chicken" ~ Anon.0 -
It always amuses me when you see some of the "tricks" other people do in spreadsheets. Entering numbers as text, justifying them and adding a space to get the positioning right etc...
You feel so much better when you've sorted it!I’m a Forum Ambassador and I support the Forum Team on the In My Home MoneySaving, Energy and Techie Stuff boards. If you need any help on these boards, do let me know. Please note that Ambassadors are not moderators. Any posts you spot in breach of the Forum Rules should be reported via the report button, or by emailing forumteam@moneysavingexpert.com.
All views are my own and not the official line of MoneySavingExpert.
0 -
According to Excel 2010:
Range_lookup: is a logical value: to find the closest match in the first column (sorted in ascending order) = TRUE or omitted; find an exact match = FALSE
OopsYou are correct. My brain knew omitted is the same as True, but my fingers typed False. Next time I'll cut and paste:)
Dave (apologetic)0 -
It always amuses me when you see some of the "tricks" other people do in spreadsheets. Entering numbers as text, justifying them and adding a space to get the positioning right etc...
I dunno about amuses, it annoys the carp out of me....especially when you finally find out why your perfectly logical & correct method of trying to do something keeps failing because some twonk has used an obscure custom format that things like vlookup don't match to :mad:......Gettin' There, Wherever There is......
I have a dodgy "i" key, so ignore spelling errors due to "i" issues, ...I blame Apple0
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 351.7K Banking & Borrowing
- 253.4K Reduce Debt & Boost Income
- 454K Spending & Discounts
- 244.7K Work, Benefits & Business
- 600.2K Mortgages, Homes & Bills
- 177.3K Life & Family
- 258.4K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.2K Discuss & Feedback
- 37.6K Read-Only Boards