Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default VLookup - finding wrong value

I am trying to use a vlookup formula to lookup data based on a time, but it
is not always giving me the correct value. It seems like if the time entered
is before noon time (12 PM) it returns the wrong value Anything after 12PM is
ok. Here is the formula I'm using. Any help would be appreciated.

Sheet = Lab Results
A B
Time Result
9:30 AM 2
9:45 AM 3
10:00 AM 4
11:30 AM 5
12:30 PM 6
1:30 PM 10

On a seperate sheet an operator enters another time into cell B5, and in C5
I have the following formula.

=vlookup(B5,Lab Results!$A$2:$B$7,2)

If I enter in 10:00 AM into B5, I get 3 in C5, when I would expect to get 4.

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 258
Default VLookup - finding wrong value

Tomic --

Your example may describe one or two issues. First -- how vlookup works.
It counts down the left column until it gets to the first value equal to or
less than the test value, then GOES BACK UP ONE ROW to get the value to
return. The way to fix this problem is to change 10:00AM to 9:59AM, and the
other times as well. That should fix the problem. Check by putting in a
time of 10:07AM, or something not right on a 'dividing line'. If not, then
you may not have your times set up correctly.

HTH

"tomic" wrote:

I am trying to use a vlookup formula to lookup data based on a time, but it
is not always giving me the correct value. It seems like if the time entered
is before noon time (12 PM) it returns the wrong value Anything after 12PM is
ok. Here is the formula I'm using. Any help would be appreciated.

Sheet = Lab Results
A B
Time Result
9:30 AM 2
9:45 AM 3
10:00 AM 4
11:30 AM 5
12:30 PM 6
1:30 PM 10

On a seperate sheet an operator enters another time into cell B5, and in C5
I have the following formula.

=vlookup(B5,Lab Results!$A$2:$B$7,2)

If I enter in 10:00 AM into B5, I get 3 in C5, when I would expect to get 4.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 154
Default VLookup - finding wrong value

tomic,

Are the operators entering the data as 1:30 AM or PM? Simply typing 1:30
will default to AM, so it could error that way. You can check this in the
Formula line of the excel document when clicking on the operator entries.

--
--Thomas [PBD]
Working hard to make working easy.
Answered your question? Click ''''Yes'''' below.


"tomic" wrote:

I am trying to use a vlookup formula to lookup data based on a time, but it
is not always giving me the correct value. It seems like if the time entered
is before noon time (12 PM) it returns the wrong value Anything after 12PM is
ok. Here is the formula I'm using. Any help would be appreciated.

Sheet = Lab Results
A B
Time Result
9:30 AM 2
9:45 AM 3
10:00 AM 4
11:30 AM 5
12:30 PM 6
1:30 PM 10

On a seperate sheet an operator enters another time into cell B5, and in C5
I have the following formula.

=vlookup(B5,Lab Results!$A$2:$B$7,2)

If I enter in 10:00 AM into B5, I get 3 in C5, when I would expect to get 4.

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default VLookup - finding wrong value

How have the times in your table been generated?

Try *manually* re-entering 10:00 AM and see if it works correctly.

If the times have been generated using a fill operation there's a good
chance that you're experiencing a "rounding issue" where the displayed time
like 10:00 AM is not *exactly* 10:00 AM.

--
Biff
Microsoft Excel MVP


"tomic" wrote in message
...
I am trying to use a vlookup formula to lookup data based on a time, but
it
is not always giving me the correct value. It seems like if the time
entered
is before noon time (12 PM) it returns the wrong value Anything after 12PM
is
ok. Here is the formula I'm using. Any help would be appreciated.

Sheet = Lab Results
A B
Time Result
9:30 AM 2
9:45 AM 3
10:00 AM 4
11:30 AM 5
12:30 PM 6
1:30 PM 10

On a seperate sheet an operator enters another time into cell B5, and in
C5
I have the following formula.

=vlookup(B5,Lab Results!$A$2:$B$7,2)

If I enter in 10:00 AM into B5, I get 3 in C5, when I would expect to get
4.

Thanks.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default VLookup - finding wrong value

Thanks.

That seems to work (adding a minute to the data), I can't say as I'm crazy
about that solution, but it works.

Thanks for your help.


"pdberger" wrote:

Tomic --

Your example may describe one or two issues. First -- how vlookup works.
It counts down the left column until it gets to the first value equal to or
less than the test value, then GOES BACK UP ONE ROW to get the value to
return. The way to fix this problem is to change 10:00AM to 9:59AM, and the
other times as well. That should fix the problem. Check by putting in a
time of 10:07AM, or something not right on a 'dividing line'. If not, then
you may not have your times set up correctly.

HTH

"tomic" wrote:

I am trying to use a vlookup formula to lookup data based on a time, but it
is not always giving me the correct value. It seems like if the time entered
is before noon time (12 PM) it returns the wrong value Anything after 12PM is
ok. Here is the formula I'm using. Any help would be appreciated.

Sheet = Lab Results
A B
Time Result
9:30 AM 2
9:45 AM 3
10:00 AM 4
11:30 AM 5
12:30 PM 6
1:30 PM 10

On a seperate sheet an operator enters another time into cell B5, and in C5
I have the following formula.

=vlookup(B5,Lab Results!$A$2:$B$7,2)

If I enter in 10:00 AM into B5, I get 3 in C5, when I would expect to get 4.

Thanks.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default VLookup - finding wrong value

may be ??

=vlookup(B5,Lab Results!$A$2:$B$7,2,false)


On Oct 6, 10:20*pm, tomic wrote:
* I am trying to use a vlookup formula to lookup data based on a time, but it
is not always giving me the correct value. It seems like if the time entered
is before noon time (12 PM) it returns the wrong value Anything after 12PM is
ok. Here is the formula I'm using. Any help would be appreciated.

Sheet = Lab Results
A * * * * * * * * * * B
Time * * * * * * * *Result
9:30 AM * * * * * 2
9:45 AM * * * * * 3
10:00 AM * * * * 4
11:30 AM * * * * 5
12:30 PM * * * * 6
1:30 PM * * * * * 10

On a seperate sheet an operator enters another time into cell B5, and in C5
I have the following formula.

=vlookup(B5,Lab Results!$A$2:$B$7,2)

If I enter in 10:00 AM into B5, I get 3 in C5, when I would expect to get 4.

Thanks.


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
VLOOKUP gets wrong value Stee n Excel Discussion (Misc queries) 4 May 28th 08 02:27 PM
Vlookup-Wrong Sheet! BB New Users to Excel 9 August 5th 07 10:57 PM
Vlookup - can't figure out what's wrong pm Excel Worksheet Functions 5 December 15th 06 08:02 PM
vlookup, what am I doing wrong? ufo_pilot Excel Discussion (Misc queries) 3 August 9th 05 05:36 PM
VLOOKUP returning wrong row jthomas Excel Worksheet Functions 6 August 3rd 05 10:32 PM


All times are GMT +1. The time now is 07:08 AM.

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"