return value based on lookup of two criteria

obiwann

Board Regular
Joined
Jan 2, 2014
Messages
142
How can I add to this formula to find the closest result in my temp. column? If I enter an exact temperature it
will return the correct result. Ex: -17.56 = 1.11759

My formula is: =INDEX(C2:C8, MATCH(G2&G3, A2:A8&B2:B8, 0))

Any help would be appreciated.

[TABLE="width: 350"]
<tbody>[TR]
[TD="width: 64"]
density
[/TD]
[TD="width: 64"]
temp.
[/TD]
[TD="width: 64"]
CTL
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155, bgcolor: transparent"][/TD]
[TD="width: 103, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]
45
[/TD]
[TD="width: 64, bgcolor: transparent"]
-17.78
[/TD]
[TD="width: 64, bgcolor: transparent"]
1.1182
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155"] Density
[/TD]
[TD="width: 103, bgcolor: transparent"]
45
[/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]
45
[/TD]
[TD="width: 64, bgcolor: transparent"]
-17.72
[/TD]
[TD="width: 64, bgcolor: transparent"]
1.11813
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155"] Temp.
[/TD]
[TD="width: 103, bgcolor: transparent"]
-17.6
[/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]
45
[/TD]
[TD="width: 64, bgcolor: transparent"]
-17.67
[/TD]
[TD="width: 64, bgcolor: transparent"]
1.11795
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155"] CTL
[/TD]
[TD="width: 103, bgcolor: transparent"]
#N/A
[/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]
45
[/TD]
[TD="width: 64, bgcolor: transparent"]
-17.61
[/TD]
[TD="width: 64, bgcolor: transparent"]
1.11777
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155, bgcolor: transparent"][/TD]
[TD="width: 103, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]
45
[/TD]
[TD="width: 64, bgcolor: transparent"]
-17.56
[/TD]
[TD="width: 64, bgcolor: transparent"]
1.11759
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155, bgcolor: transparent"][/TD]
[TD="width: 103, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]
45
[/TD]
[TD="width: 64, bgcolor: transparent"]
-17.50
[/TD]
[TD="width: 64, bgcolor: transparent"]
1.11741
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155, bgcolor: transparent"][/TD]
[TD="width: 103, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="width: 64, bgcolor: transparent"]
45
[/TD]
[TD="width: 64, bgcolor: transparent"]
-17.44
[/TD]
[TD="width: 64, bgcolor: transparent"]
1.11723
[/TD]
[TD="width: 17, bgcolor: transparent"][/TD]
[TD="width: 155, bgcolor: transparent"][/TD]
[TD="width: 103, bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Try:
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Excel Workbook
ABCDEF
1densitytemp.CTL
245-17.781.1182Density45
345-17.721.11813Temp.-17.6
445-17.671.11795CTL1.11777
545-17.611.11777
645-17.561.11759
745-17.51.11741
845-17.441.11723
Sheet
 
Upvote 0
If you want something a little fancier, this non-array formula will find the 2 bracketing values and perform linear interpolation between them:

=FORECAST(F3,OFFSET($C$2,LOOKUP(2,1/(($A$2:$A$8=F2)*($B$2:$B$8<=F3)),ROW($C$2:$C$8)-ROW($C$2)),0,2),OFFSET($B$2,LOOKUP(2,1/(($A$2:$A$8=F2)*($B$2:$B$8<=F3)),ROW($C$2:$C$8)-ROW($C$2)),0,2))
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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