#ERROR in Lookup function

matthewlouis

Active Member
Joined
Mar 28, 2014
Messages
374
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello Experts,

In looking up the last number in a column, I am using =IFERROR(LOOKUP(2,1/(Q3:Q62<>""),Q3:Q62),""). It's correctly stating the right number in each column (if there is a number).

However, when there is NOT a number in the column, I get the #ERROR message with that IFERROR formula (?) So I need a formula to return BLANK if there is not a number in the column because it determines another calculation if it is blank.

What would be the formula to return an empty cell if there is no number in the column? What am I missing in my formula?

Thanks in advance!!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
The formula you posted should be returning the contents of the last filled cell in the specified range, whether it is text or a number. It will return "" if the specified range is empty.

If you want the last number in that range try:
Code:
=IFERROR(LOOKUP(1E+307,Q3:Q62),"")
 
Upvote 0
Is this connected to a database? I've never heard of Excel returning #ERROR though it's common in Access, SSRS, Sharepoint, etc.
 
Upvote 0
Joe, your formula returned a blank (?) and there was a number in the column.
 
Last edited:
Upvote 0
Yes, I use a database called xlq that returns stock prices based on the date
 
Upvote 0
OK, think I have it now.

=IFERROR(LOOKUP(2,1/(ISNUMBER(Q3:Q63)),Q3:Q63),"")

Thanks for the help!!! :)
 
Last edited:
Upvote 0
Joe, when I said there was a number in the column, I put your formula in another columns where there IS a number and it returned a blank.

Sorry, hope that communicates it better.

So it seems the "numbers" in your range are texts, not real numbers
To check, try
=ISNUMBER(Q3) and copy down

M.
 
Upvote 0
Actually, this is what worked . . .

=IFERROR(LOOKUP(2,1/(ISNUMBER(Q3:Q63)),Q3:Q63),"")

Thanks for all the help :)
 
Upvote 0
Actually, this is what worked . . .

=IFERROR(LOOKUP(2,1/(ISNUMBER(Q3:Q63)),Q3:Q63),"")

Thanks for all the help :)

This will skip text numbers and logical values (like TRUE) in Q3:Q63, while

=IFERROR(LOOKUP(9.99999999999999E+307,1/Q3:Q63,Q3:Q63),"")

won't.

If there are no text numbers or logical values, both formulas will work the same way.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,755
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top