Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
BEAR94
 
Posts: n/a
Default Need help with HLOOKUP and MATCH functions


I need help using HLOOKUP and MATCH functions. I uses these 2 functions
several times before, but today I found confusing problem related to
them.

I attached a file to this e-mail that address the issue (my original
file is more complex).

In the attached file there is an array of end-of-month dates in row 2,
and numbers related to each date one row below.

I created another date array in row 6 that have same dates/one to two
days after dates in row 2.

I created a simple MATCH function in row 8 that if it works correctly
will output the column number, i.e. result in cell A8 should be 1, in
cell B8 should be 2, and so on.
However, the result that I got is totally different.


I also created HLOOKUP calculation in row 10. The function works well
if date in row 6 is exactly the same as in row 2. However, it does not
work for dates thta are slightly different, for example dates in column
E (12/29/2000 and 12/31/2000). I added an IF function in the formula
so if the dates are different the HLOOKUP function shall use value
TRUE, which will look for the largest value in the array, but smaller
than the lookup value. So for column E the right answer should be
12/29/2000, but the function spit out 06/30/2005.

Anybody knows what is wrong with my file? Does my result expectation
above correct? Anyone know how to fix this? Thanks!


+-------------------------------------------------------------------+
|Filename: PROBLEM.xls.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3686 |
+-------------------------------------------------------------------+

--
BEAR94
------------------------------------------------------------------------
BEAR94's Profile: http://www.excelforum.com/member.php...o&userid=26218
View this thread: http://www.excelforum.com/showthread...hreadid=395218

  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Your dates are really TEXT entries and are not true Excel dates.

You can convert them to real dates by:

Select any empty cell and make sure that cell is formatted as GENERAL.
Copy that empty cell
Select all of rows 2 and 6
With the cursor inside one of those ranges, do:
EditPaste SpecialAddOK

Then with both rows 2 and 6 still selected FormatCellsDATEOK

Change your lookup formula to:

=HLOOKUP(A6,2:2,1,1)

Biff

"BEAR94" wrote in
message ...

I need help using HLOOKUP and MATCH functions. I uses these 2 functions
several times before, but today I found confusing problem related to
them.

I attached a file to this e-mail that address the issue (my original
file is more complex).

In the attached file there is an array of end-of-month dates in row 2,
and numbers related to each date one row below.

I created another date array in row 6 that have same dates/one to two
days after dates in row 2.

I created a simple MATCH function in row 8 that if it works correctly
will output the column number, i.e. result in cell A8 should be 1, in
cell B8 should be 2, and so on.
However, the result that I got is totally different.


I also created HLOOKUP calculation in row 10. The function works well
if date in row 6 is exactly the same as in row 2. However, it does not
work for dates thta are slightly different, for example dates in column
E (12/29/2000 and 12/31/2000). I added an IF function in the formula
so if the dates are different the HLOOKUP function shall use value
TRUE, which will look for the largest value in the array, but smaller
than the lookup value. So for column E the right answer should be
12/29/2000, but the function spit out 06/30/2005.

Anybody knows what is wrong with my file? Does my result expectation
above correct? Anyone know how to fix this? Thanks!


+-------------------------------------------------------------------+
|Filename: PROBLEM.xls.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3686 |
+-------------------------------------------------------------------+

--
BEAR94
------------------------------------------------------------------------
BEAR94's Profile:
http://www.excelforum.com/member.php...o&userid=26218
View this thread: http://www.excelforum.com/showthread...hreadid=395218



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
HLookup? or an array function?? Murph Excel Worksheet Functions 5 May 11th 05 05:44 PM
Vlookup and Hlookup Phlogiston2312 Excel Worksheet Functions 1 April 21st 05 04:59 PM
Can vlookup or hlookup look to other worksheets within a workbook. flgc54 Excel Worksheet Functions 1 March 12th 05 12:31 AM
Lookup then Match and insert value from next column Tenacity Excel Worksheet Functions 3 March 4th 05 02:49 AM
Offset, indirect, match function limitation on linked worksheets. NewAlgier Excel Worksheet Functions 1 December 6th 04 11:55 PM


All times are GMT +1. The time now is 03:20 PM.

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

About Us

"It's about Microsoft Excel"