Lookup a value in a table

steve1123

Board Regular
Joined
Nov 1, 2012
Messages
74
Hello,

I have a predicament regarding a table that I'm trying to solve.

There is a table with Weights along the left side, ISA Temperature Deviation along the top, and Anti-Ice correction along the bottom.

For a given weight, ISA Dev, and whether or not the Anti-ice system is on, an airplane can reach a certain max altitude, which this table will show you. Using a combination of VLookup, HLookup, and Match functions, I have already put together a formula to compute the max altitude for a given weight, ISA deviation, and Anti-ice status.

The Anti-ice system takes its power from the engines, so if the Anti-ice system is on, the aircraft cannot fly as high, hence the negative corrections if the system is on.

Now, the problem. There are some situations where a pilot may want to know, for a given ISA dev and Anti-ice status, the highest weight the aircraft can be at in order to reach a specified altitude. If the aircraft is too heavy at a given time, as the fuel is burned, the aircraft may get down to the required weight, at which point the aircraft can climb to the requested altitude.

Essentially, the 4 variables are Weight, ISA Dev, Altitude, and whether or not the Anti-Ice system is on. I need a way to "read" the table when the known values are ISA Dev, Altitude, and Anti-ice status on/off. The flow of the formula should go something like this:

If the Anti-ice system is not on:
1) Based on user input, ISA Dev, go to the column for the current ISA Dev.
2) Based on user input, Desired Altitude, go down that column to find the bottom-most instance of that altitude.
3) Move left to find the weight. This will represent the heaviest the aircraft can be an still reach and maintain that altitude.

I have attached the chart. The cell containing Max Altitude is A1. I have the fields for user input at the top of the chart for simplicity. The formula should be in G2.

For example, if the Anti-ice system is not on:
ISA Dev: -5
Anti-ice on?: No
Desired Altitude: 36000ft
Result should be: 51000Kg

If the Anti-ice system is on, this requires some extra work:
1) Take the given requested altitude and add the correction value at the bottom of the chart. In the example, 36000 + 5000 = 41000Kg
2) Repeat steps 1-3 above, essentially replacing 36000, with 41000 (since you have to subtract the 5000ft correction from 41000ft, in order to maintain the requested 36000ft).

In the above example, if the Anti-ice system is on, the result should be 39000Kg.

The main thing to keep in mind is that the service ceiling is 41000ft, so no matter what, the assumed altitude cannot go past 41000. If a pilot is requesting an altitude that cannot be reached at any weight, the result should produce an "Unable" response.

Thanks in advance for any assistance. I know this one is rather complicated. It's been stumping me for a while.

[TABLE="width: 576"]
<tbody>[TR]
[TD="class: xl65, width: 64"]Max Altitude[/TD]
[TD="class: xl66, width: 64"][/TD]
[TD="class: xl66, width: 64"][/TD]
[TD="class: xl66, width: 64"][/TD]
[TD="class: xl66, width: 64"]ISA Dev[/TD]
[TD="class: xl66, width: 64"]Req Alt[/TD]
[TD="class: xl66, width: 64"]Anti-ice
on?[/TD]
[TD="class: xl66, width: 64"]Weight[/TD]
[TD="class: xl66, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl67"]WEIGHT[/TD]
[TD="class: xl65"]ISA DEVIATION (C)[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"][/TD]
[TD="class: xl66"]5[/TD]
[TD="class: xl66"]38000[/TD]
[TD="class: xl66"]NO[/TD]
[TD="class: xl66"]RESULT
HERE[/TD]
[TD="class: xl66"][/TD]
[/TR]
[TR]
[TD="class: xl67"][/TD]
[TD="class: xl65, align: right"]-15[/TD]
[TD="class: xl65, align: right"]-10[/TD]
[TD="class: xl65, align: right"]-5[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]15[/TD]
[TD="class: xl65, align: right"]20[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]30000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]31000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]32000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]33000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]34000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]35000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]36000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]37000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]38000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]39000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]41000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]40000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]41000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]40000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]42000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]43000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]39000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]44000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]45000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]38000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]46000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]47000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]48000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]37000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]33000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]49000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]33000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]50000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]32000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]51000[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]36000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]31000[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]51800[/TD]
[TD="class: xl68, align: right"]29000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]35000[/TD]
[TD="class: xl68, align: right"]34000[/TD]
[TD="class: xl68, align: right"]31000[/TD]
[/TR]
[TR]
[TD="class: xl65"]Correction
ENG & WNG
ANTI-ICE ON[/TD]
[TD="class: xl68, align: right"]0[/TD]
[TD="class: xl68, align: right"]-3000[/TD]
[TD="class: xl68, align: right"]-5000[/TD]
[TD="class: xl68, align: right"]-5000[/TD]
[TD="class: xl68, align: right"]-5000[/TD]
[TD="class: xl68, align: right"]-5000[/TD]
[TD="class: xl68, align: right"]-8000[/TD]
[TD="class: xl68, align: right"]-10000[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi Steve,

I have this working splendidly.

=VLOOKUP(F2,A4:I26,MATCH(E2,B3:I3,0),FALSE)+IF(G2="YES",HLOOKUP(E2,B3:I27,25,FALSE),0)

Cheers!
 
Upvote 0
Wait, did I get something backwards? I think maybe so.

Also, why not build a relational database? Most of these values seem very repetitive. This might be a good visual chart, but there is a lot less going on than it seems.
Also, I added data validation on the input values. My formula did not account for the possiblity of a typo or a unlisted value.
 
Upvote 0
Try this. If it does not cover all circumstances, give the circumstances where it fails, what the correct result should be for those circumstances, and why.

Excel Workbook
ABCDEFGHI
1Max AltitudeISA DevReq AltAnti-iceWeight
2WEIGHTISA DEVIATION (C)-536000NO51000
3-15-10-505101520
4300002900034000410004100041000410004100041000
5310002900034000410004100041000410004100041000
6320002900034000410004100041000410004100041000
7330002900034000410004100041000410004100041000
8340002900034000410004100041000410004100041000
9350002900034000410004100041000410004100040000
10360002900034000410004100041000410004100040000
11370002900034000410004100041000410004100039000
12380002900034000410004100041000410004000039000
13390002900034000410004100040000400004000038000
14400002900034000400004000040000400003900038000
15410002900034000400004000040000400003900037000
16420002900034000390003900039000390003800037000
17430002900034000390003900039000390003800037000
18440002900034000380003800038000380003800036000
19450002900034000380003800038000380003700036000
20460002900034000370003700037000370003700035000
21470002900034000370003700037000370003600034000
22480002900034000370003700037000370003600033000
23490002900034000360003600036000360003500033000
24500002900034000360003600036000360003500032000
25510002900034000360003500035000350003400031000
26518002900034000350003500035000350003400031000
27Correction0-3000-5000-5000-5000-5000-8000-10000
Flight Calc
 
Upvote 0
Ok, I got it in two formulas, but it works REALLY well (assuming your example should be 41000, not 51000 - which is not even on your table):

Paste this into Cell I1 (make this the color of the background)
=MID(CELL("address",INDEX(B3:I3,MATCH(E2,B3:I3,0))),2,1)&MATCH(F2,A4:A26,0)+3

This returns the value D10
(That is the cell where this max alt meets this ISA DEV)

Then, in Cell H2

=INDIRECT(I1)+IF(G2="YES",HLOOKUP(E2,B3:I27,25,FALSE),0)

You can make absolute and add error traps if you need.

Which a table though, data validation is still my advice.

With data validation, you can lock the cells and not have anyone do anything but choose the drop down values for the three inputs.


Hope this helps!
 
Upvote 0
@Peter

With low Required Altitudes, like F2 = 32000, your formula returns Unable
Maybe this fix it
=IFERROR(INDEX(A5:A27,AGGREGATE(14,6,(ROW(A5:A27)-ROW(A5)+1)/((B5:I27>=E2-(B4:I4=D2)*(B28:I28)*(F2="YES"))*(B4:I4=D2)),1)),"Unable")

M.
 
Upvote 0
@Marcelo
You may be right but I'm not sure. Suppose the ISA Dev =-5, Anti-Ice = No and Req Alt = 32,000 then following the OP's method ..
1) Based on user input, ISA Dev, go to the column for the current ISA Dev.
2) Based on user input, Desired Altitude, go down that column to find the bottom-most instance of that altitude.
.. the process would fail at step 2 since there is no 32000 values in that column. So, it may be that such a requested altitude is not allowed/possible for that situation??


@Charleton
I think you are still working the wrong way around. I believe the OP is trying to find out the highest weight the aircraft can carry, not the altitude. You will see that 51000 is in the table - at cell A25 in my screen shot.
 
Last edited:
Upvote 0
Hi Peter, thanks for clarifying. I was totally confused by the way the rows and column headers are ordered, and how the Range from B4:B26 would have no specific answer based on the data provided. I apologize for any confusion I caused.
 
Upvote 0
Here is my take on it:

=IFERROR(LOOKUP(2,1/(INDEX(B4:I27,0,MATCH(E2,B3:I3))=F2-HLOOKUP(E2,B3:I27,25,0)*(G2<>"NO")),A4:A26),"Unable")

and some (very limited) test results:

-5 / 36000 / No: my formula 51800; Peter's formula "Unable"
20 / 21000 / Yes: my formula 51800; Peter's formula 51000
 
Upvote 0
@Marcelo
You may be right but I'm not sure. Suppose the ISA Dev =-5, Anti-Ice = No and Req Alt = 32,000 then following the OP's method .... the process would fail at step 2 since there is no 32000 values in that column. So, it may be that such a requested altitude is not allowed/possible for that situation??

Yes, if we strictly follow this sentence the formula must return Unable. But this, IMHO, can cause some confusion.
I was thinking in real life: could not the pilot ask for a lower altitude than those on the table? After all, 32,000 feet seems a reasonable altitude for a modern aircraft.
Another advantage in using greater or equal is that requests for non-exact altitudes such as 35500 would be accepted and treated as the value immediately above (36000).

M.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

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