multiple lookup question

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I would like to find out those days that either NY temperature of 29 or higher or LA had a temperature 26 or higher. I would like to know the date that it occurred and what the Price and Nextday-prices were. Any help would be very much appreciated. Thank you.

Sample of the data

DateNY temperatureLA temperaturePriceNextday price
02/07/201832.2226.9149.9269.88
03/07/201832.8528.5148.8154.3
05/07/201830.6924.5853.4343.77
06/07/201828.9223.1630.0235.19
09/07/201827.7425.5240.5934.6
10/07/201832.2226.9844.8742.53
11/07/201831.0824.1342.0138.76
12/07/201828.5123.9634.6936.94

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

.
.
.

24/09/201819.0617.1523.2731.95
25/09/201824.5520.0331.9837.05
26/09/201826.2219.1735.3437.4
27/09/201817.0114.3427.0432.37
28/09/201820.5616.6330.2430.97

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

The file can be downloaded here

https://drive.google.com/file/d/1G6K4jiLwNjLx4bllMxgmudJyGFCjPxTa/view?usp=sharing
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Book1
ABCDE
1DateNY temperatureLA temperaturePriceNextday price
22/7/201832.2226.9149.9269.88
33/7/201832.8528.5148.8154.3
45/7/201830.6924.5853.4343.77
56/7/201828.9223.1630.0235.19
69/7/201827.7425.5240.5934.6
710/7/201832.2226.9844.8742.53
811/7/201831.0824.1342.0138.76
912/7/201828.5123.9634.6936.94
Sheet1



Book1
ABCDEF
1NY29
2LA26
35
4IdxDateNY temperatureLA temperaturePriceNextday price
512/7/201832.2226.9149.9269.88
623/7/201832.8528.5148.8154.3
735/7/201830.6924.5853.4343.77
8610/7/201832.2226.9844.8742.53
9711/7/201831.0824.1342.0138.76
Sheet2


In A3 control+shift+enter, not just enter:

=SUM(IF((Sheet1!B2:B9>=B1)+(Sheet1!C2:C9>=B2),1))

In A5, control+shift+enter, not just enter, and copy down:

=IF(ROWS($1:1)>$A$3,"",SMALL(IF((Sheet1!$B$2:$B$9>=$B$1)+(Sheet1!$C$2:$C$9>=$B$2),ROW(Sheet1!$A$2:$E$9)-ROW(INDEX(Sheet1!$A$2:$E$9,1,1))+1),ROWS($1:1)))

In B5 just enter, copy across, and down:

=IF($A5="","",INDEX(Sheet1!$A$2:$E$9,$A5,MATCH(B$4,Sheet1!$A$1:$E$1,0)))
 
Upvote 0
Thank you so much for all your help. I will go through them now to understand them. Just a question. Can that be solved by using pivot table or not possible with pivot tables? Thank you so much once again.
 
Upvote 0
Thank you so much for all your help. I will go through them now to understand them. Just a question. Can that be solved by using pivot table or not possible with pivot tables? Thank you so much once again.


Book1
ABCDEF
1DateNY temperatureLA temperaturePriceNextday priceCRIT
22/7/201832.2226.9149.9269.88TRUE
33/7/201832.8528.5148.8154.3TRUE
45/7/201830.6924.5853.4343.77TRUE
56/7/201828.9223.1630.0235.19FALSE
69/7/201827.7425.5240.5934.6FALSE
710/7/201832.2226.9844.8742.53TRUE
811/7/201831.0824.1342.0138.76TRUE
912/7/201828.5123.9634.6936.94FALSE
Sheet1


In F2 enter and copy down:

=(B2>=29)+(C2>=26)>0


Book1
ABCDE
1CRITTRUE
2
3Row LabelsSum of NY temperatureSum of LA temperatureSum of PriceSum of Nextday price
47-Feb32.2226.9149.9269.88
57-Mar32.8528.5148.8154.3
67-May30.6924.5853.4343.77
77-Oct32.2226.9844.8742.53
87-Nov31.0824.1342.0138.76
9Grand Total159.06131.11239.04249.24
10
Sheet5
 
Upvote 0
Many thanks. I will try to understand this as well. Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,215,522
Messages
6,125,312
Members
449,218
Latest member
Excel Master

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