[Solved] #N/A from VLOOKUP in first row

Discuss the spreadsheet application
Post Reply
endbrown
Posts: 6
Joined: Tue Sep 18, 2018 12:00 am

[Solved] #N/A from VLOOKUP in first row

Post by endbrown »

I have a spreadsheet with several tabs that pull values from a tab labeled "rates". The rates are 11 rows (1-11) and three columns. Column A is a beginning value, column B is the ending value, and Column C is a percentage.

Here is the formula I am using, using cell B12 in tab 1 as an example:

=VLOOKUP(B12;Rates;3;1)

For some reason, it only works if I put a value in Cell B12 that fits within the ranges in rows 3 - 11. If I put a value into Cell B12 that is within the ranges of either rows 1 or 2, I get "#N/A".

What am I doing wrong?

Thank you
Last edited by MrProgrammer on Fri May 22, 2026 4:55 pm, edited 3 times in total.
Reason: Edited topic's subject
Windows 10, OpenOffice 4.1.3
FJCC
Moderator
Posts: 9626
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: VLOOKUP help

Post by FJCC »

Are the values in column A of Rates sorted in ascending order? The 1 you have as the fourth parameter tells VLOOKUP that the values are sorted.

It would be very helpful if you uploaded an example document. We would only need the 11 rows on the rates sheet and an example of a failing VLOOKUP function. To upload a document, click Post Reply and look for the Attachments tab just below the box where you type a response.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
karolus
Volunteer
Posts: 1245
Joined: Sat Jul 02, 2011 9:47 am

Re: VLOOKUP help

Post by karolus »

endbrown wrote: Mon May 18, 2026 1:08 pm The rates are 11 rows (1-11) and three columns. Column A is a beginning value, column B is the ending value, and Column C is a percentage.

Here is the formula I am using, using cell B12 in tab 1 as an example:

=VLOOKUP(B12;Rates;3;1)

For some reason, it only works if I put a value in Cell B12 that fits within the ranges in rows 3 - 11. If I put a value into Cell B12 that is within the ranges of either rows 1 or 2, I get "#N/A".
Looks like your »Rates« is a named-reference to …A3:C11 but not A1:C11 as you assume?
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
endbrown
Posts: 6
Joined: Tue Sep 18, 2018 12:00 am

Re: VLOOKUP help

Post by endbrown »

Here is what I have in the Rates Tab:
-------A--------B-------C
1)--1000----1300----29.5%
2)--1301----1600----30.0%
3)--1601----1900----30.5%
4)--1901----2200----31.0%
5)--2201----2500----31.5%
6)--2501----2800----32.0%
7)--2801----3100----32.5%
8)--3101----3400----33.0%
9)--3401----3700----33.5%
10)--3701----4000----34.0%
11)--4001----4300----34.5%

The formula I have on the other tabs is "=VLOOKUP(C45;Rates;3;1)" where C45 is the cell that I want to calculate the percentage of.

For some reason, if the value is (Let's say) 1050, I get "#N/A". If the value is over 1300 then the proper percentage calculates.

I'm not sure what I'm doing wrong.

I appreciate your help.
Windows 10, OpenOffice 4.1.3
User avatar
karolus
Volunteer
Posts: 1245
Joined: Sat Jul 02, 2011 9:47 am

Re: VLOOKUP help

Post by karolus »

endbrown wrote: Wed May 20, 2026 11:36 am Here is what I have in the Rates Tab:
-------A--------B-------C
1)--1000----1300----29.5%
2)--1301----1600----30.0%
3)--1601----1900----30.5%
4)--1901----2200----31.0%
5)--2201----2500----31.5%
6)--2501----2800----32.0%
7)--2801----3100----32.5%
8)--3101----3400----33.0%
9)--3401----3700----33.5%
10)--3701----4000----34.0%
11)--4001----4300----34.5%

The formula I have on the other tabs is "=VLOOKUP(C45;Rates;3;1)" where C45 is the cell that I want to calculate the percentage of.
the Sheetname without any CellAddress is not valid !
use:

Code: Select all

=VLOOKUP(C45;Rates.$A$1:$C$11;3;1)
OR check and fix the RangeAddress BEHIND the Named-Range »Rates« … it should be $Rates.$A$1:$C$11 (⇒Sheet⇒NamedRanges…⇒Manage…)

btw. there is no need for Column B in your LOOKUP-table.
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
endbrown
Posts: 6
Joined: Tue Sep 18, 2018 12:00 am

Re: VLOOKUP help

Post by endbrown »

That did it.
Thank you very much.
Hope you have a phenomenal day.
Windows 10, OpenOffice 4.1.3
Post Reply