#1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 33
Default Hlookup

I have this formula
=hlookup($a$1,sheet1!$a$21:$ap$41,1.false)
It works fine but, returns #NA if $a$1 not found.
How can I make it return "out of range"
Thank you
Duane Platt
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default Hlookup

look in the help index for ISNA

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Duplatt" wrote in message
...
I have this formula
=hlookup($a$1,sheet1!$a$21:$ap$41,1.false)
It works fine but, returns #NA if $a$1 not found.
How can I make it return "out of range"
Thank you
Duane Platt


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 256
Default Hlookup

Try...

=IF($A$1<"",IF(ISNUMBER(MATCH($A$1,Sheet1!$A$21:$ AP$21,0)),HLOOKUP($A$1,
Sheet1!$A$21:$AP$41,1,FALSE),"Out of Range"),"")

However, for this example, since HLOOKUP is not returning a value from
one of the rows below the first one in the lookup table, the following
should suffice...

=IF($A$1<"",IF(ISNUMBER(MATCH($A$1,Sheet1!$A$21:$ AP$41,0)),$A$1,"Out of
Range"),"")

Hope this helps!

In article ,
Duplatt wrote:

I have this formula
=hlookup($a$1,sheet1!$a$21:$ap$41,1.false)
It works fine but, returns #NA if $a$1 not found.
How can I make it return "out of range"
Thank you
Duane Platt

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 33
Default Hlookup

Thank you Domenic.
Tried the formula. returns "out of range" regardless of what numbers are in
$a$1.
$a$1 is 2007 -- current year, on sheet 2
Sheet1!$a$21:$ap$41 are years from 2002 to 2042
would appreciate any help
Duane

"Domenic" wrote:

Try...

=IF($A$1<"",IF(ISNUMBER(MATCH($A$1,Sheet1!$A$21:$ AP$21,0)),HLOOKUP($A$1,
Sheet1!$A$21:$AP$41,1,FALSE),"Out of Range"),"")

However, for this example, since HLOOKUP is not returning a value from
one of the rows below the first one in the lookup table, the following
should suffice...

=IF($A$1<"",IF(ISNUMBER(MATCH($A$1,Sheet1!$A$21:$ AP$41,0)),$A$1,"Out of
Range"),"")

Hope this helps!

In article ,
Duplatt wrote:

I have this formula
=hlookup($a$1,sheet1!$a$21:$ap$41,1.false)
It works fine but, returns #NA if $a$1 not found.
How can I make it return "out of range"
Thank you
Duane Platt


  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,393
Default Hlookup

Did you read Don' G's advice?
=IF(ISNA(hlookup($a$1,sheet1!$a$21:$ap$41,1,false) ,"",hlookup($a$1,sheet1!$a$21:$ap$41,1,false))
This returns a 'blank' in place of #N/A when $A$1 is not found.
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Duplatt" wrote in message
...
I have this formula
=hlookup($a$1,sheet1!$a$21:$ap$41,1.false)
It works fine but, returns #NA if $a$1 not found.
How can I make it return "out of range"
Thank you
Duane Platt





  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 256
Default Hlookup

Maybe there's a mismatch in the data type between the lookup value in A1
and the lookup range in A21:AP21. Let's say A1 contains 2007 and F21
contains 2007, what does the following return?

=A1=F21

In article ,
Duplatt wrote:

Thank you Domenic.
Tried the formula. returns "out of range" regardless of what numbers are in
$a$1.
$a$1 is 2007 -- current year, on sheet 2
Sheet1!$a$21:$ap$41 are years from 2002 to 2042
would appreciate any help
Duane

  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 33
Default Hlookup

Domenic
I think the data type was a mismatch. The ISNUMBER(MATCH works fine now
The ISNUNBER - MATCH - HLOOKUP still returns "out of range"
I do need the HLOOKUP feature for other data on the page.
Appreciate any help
Duane

"Domenic" wrote:

Maybe there's a mismatch in the data type between the lookup value in A1
and the lookup range in A21:AP21. Let's say A1 contains 2007 and F21
contains 2007, what does the following return?

=A1=F21

In article ,
Duplatt wrote:

Thank you Domenic.
Tried the formula. returns "out of range" regardless of what numbers are in
$a$1.
$a$1 is 2007 -- current year, on sheet 2
Sheet1!$a$21:$ap$41 are years from 2002 to 2042
would appreciate any help
Duane


  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 33
Default Hlookup

Bernard
Yes, I did see Don' G,s note
I'm too new at this to understand how to put various funtions together
I tried your suggestion , I get "error flag" I have read & reread & retyped.
Still can't make it work
Any help appreciated - Duane

"Bernard Liengme" wrote:

Did you read Don' G's advice?
=IF(ISNA(hlookup($a$1,sheet1!$a$21:$ap$41,1,false) ,"",hlookup($a$1,sheet1!$a$21:$ap$41,1,false))
This returns a 'blank' in place of #N/A when $A$1 is not found.
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Duplatt" wrote in message
...
I have this formula
=hlookup($a$1,sheet1!$a$21:$ap$41,1.false)
It works fine but, returns #NA if $a$1 not found.
How can I make it return "out of range"
Thank you
Duane Platt




  #9   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 256
Default Hlookup

Notice that the lookup range for MATCH is...

Sheet1!$A$21:$AP$21

not

Sheet1!$A$21:$AP$41

Could this be the problem?

In article ,
Duplatt wrote:

Domenic
I think the data type was a mismatch. The ISNUMBER(MATCH works fine now
The ISNUNBER - MATCH - HLOOKUP still returns "out of range"
I do need the HLOOKUP feature for other data on the page.
Appreciate any help
Duane

  #10   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 33
Default Hlookup

Typo on my part
I have reconstrusted the scene on another sheet and still get the same result
The ISNUMBER(MATCH works fine
The ISNUMBER(MATCH - HLOOKUP only produces "Out of Range"
I really do appreciate any help.
Thanks - Duane

"Domenic" wrote:

Notice that the lookup range for MATCH is...

Sheet1!$A$21:$AP$21

not

Sheet1!$A$21:$AP$41

Could this be the problem?

In article ,
Duplatt wrote:

Domenic
I think the data type was a mismatch. The ISNUMBER(MATCH works fine now
The ISNUNBER - MATCH - HLOOKUP still returns "out of range"
I do need the HLOOKUP feature for other data on the page.
Appreciate any help
Duane




  #11   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,393
Default Hlookup

What "error flag" ?
You say that you HLOOKUP works expect when there is no match
Use copy and paste to get
=IF(ISNA(your-formula), " ", your-formula)
or try
=IF(ISERROR(your-formula), " ", your-formula)

Are you using English-language version of Excel - if not use the correct
delimiter (e.g use ; rather than , between arguments)
If this fails send me a sample file (to my private email, not to the
newsgroup)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Duplatt" wrote in message
...
Bernard
Yes, I did see Don' G,s note
I'm too new at this to understand how to put various funtions together
I tried your suggestion , I get "error flag" I have read & reread &
retyped.
Still can't make it work
Any help appreciated - Duane

"Bernard Liengme" wrote:

Did you read Don' G's advice?
=IF(ISNA(hlookup($a$1,sheet1!$a$21:$ap$41,1,false) ,"",hlookup($a$1,sheet1!$a$21:$ap$41,1,false))
This returns a 'blank' in place of #N/A when $A$1 is not found.
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Duplatt" wrote in message
...
I have this formula
=hlookup($a$1,sheet1!$a$21:$ap$41,1.false)
It works fine but, returns #NA if $a$1 not found.
How can I make it return "out of range"
Thank you
Duane Platt






  #12   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 256
Default Hlookup

If you try...

=A1=F21

....where A1 contains the lookup value and F21 contains the supposedly
matching value, what does it return?

In article ,
Duplatt wrote:

Typo on my part
I have reconstrusted the scene on another sheet and still get the same result
The ISNUMBER(MATCH works fine
The ISNUMBER(MATCH - HLOOKUP only produces "Out of Range"
I really do appreciate any help.
Thanks - Duane

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
V+HLookup? Susan Excel Discussion (Misc queries) 3 June 22nd 07 06:20 PM
Hlookup? Eden397 Excel Worksheet Functions 1 June 6th 07 03:43 PM
Hlookup for row 3 and 4 dilettante Excel Worksheet Functions 2 March 30th 07 02:34 PM
Hlookup? coa01gsb Excel Worksheet Functions 5 March 9th 06 02:03 PM
HLookup ??? scott Excel Discussion (Misc queries) 2 December 16th 04 09:57 PM


All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"