# Lookup Problems

#### Brabed

##### Board Regular
I have two worksheets. One (Worksheet 1) contains hourly data for the currencies market. The other (Worksheet 2) contains daily data. In column A of both sheets I have a numerical representation of the date. I'm trying to call up the high of the day of yesterday's daily data and compare with the current hourly data of today. I am trying a lookup function that looks like this:

=lookup(A1-1,'Worskheet2!A:A,Worksheet2!D:D)

This should return yesterday's high (Column D) which would be in the same row as yesterday's corresponding date number (A1-1). Now the problem I'm having is that instead of returning the correct value, it always retuns the value of the very last populated cell in column D. What am I doing wrong?

I have used similar LOOKUP formulas with no troubles. Let me know if I am not clear in my question.

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

#### Brabed

##### Board Regular
Problem solved. It didn't like that the numbers were in descending order, I had to convert to ascending.

#### Domski

##### Well-known Member
Hi,

Looks fine to me assuming it should look like:

=lookup(A1-1,Worksheet2!A:A,Worksheet2!D:D)

Could always try:

=INDEX(Worksheet2!D:D,MATCH(A1-1,Worksheet2!A:A,0))

It wouldn't matter what order your data was in then.

Dom

Replies
7
Views
174
Replies
2
Views
85
Replies
6
Views
434
Replies
5
Views
566
Replies
6
Views
128

1,191,228
Messages
5,985,392
Members
439,962
Latest member
max_york

### 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.

### Which adblocker are you using?

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

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