Lookup nth column value for specified 'n'

Ian McPherson

New Member
Joined
Feb 20, 2018
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Attached example shows a table of % values. For a specified n=C4 value, lookup up the corresponding %'s from 1-n (yellow highlight).
Thanking you in advance.

Example.xlsx
BCDEFGHIJKLMNOPQRSTUVWXYZAAABAC
4Select21%12345678910111213141516171819202122
5114.0%1100.0%65.0%50.0%34.0%31.0%25.0%23.0%21.0%20.5%20.0%19.0%18.0%18.0%17.0%17.0%16.0%16.0%15.0%15.0%14.0%14.0%13.0%
6210.0%235.0%30.0%28.0%24.0%20.0%19.0%18.0%17.0%17.0%16.0%15.0%15.0%14.0%13.0%12.0%12.0%11.0%11.0%10.0%10.0%9.0%
738.0%320.0%22.0%18.0%17.5%16.5%15.0%14.5%14.0%13.0%13.0%12.0%12.0%10.0%9.0%9.0%9.0%8.5%8.5%8.0%7.8%
846.6%416.0%15.0%15.0%14.0%13.0%12.0%12.0%11.0%11.0%10.0%9.0%8.0%7.5%7.0%7.0%7.0%6.7%6.6%6.5%
956.0%512.0%12.5%11.5%11.0%10.0%10.0%9.5%9.5%8.0%8.0%7.0%7.0%6.5%6.5%6.3%6.2%6.0%6.0%
1065.5%610.0%9.0%9.0%8.0%8.0%8.0%8.0%7.0%7.0%6.4%6.5%6.0%6.0%5.8%5.7%5.5%5.5%
1175.0%77.0%7.0%7.0%5.5%6.5%6.5%6.0%5.8%5.9%6.0%5.5%5.5%5.3%5.2%5.0%5.0%
1284.6%86.0%6.0%5.0%5.5%5.0%5.0%4.9%5.4%5.5%5.0%5.0%4.9%4.7%4.6%4.6%
1394.2%95.0%4.5%4.5%4.0%4.6%4.5%5.0%5.0%4.7%4.6%4.5%4.4%4.2%4.2%
14103.9%104.0%3.8%3.6%4.2%4.2%4.6%4.6%4.4%4.3%4.1%4.1%3.9%3.9%
15113.6%113.2%3.3%3.8%3.9%4.2%4.3%4.2%4.0%3.8%3.8%3.6%3.6%
16123.4%123.1%3.4%3.5%3.8%3.9%3.9%3.7%3.5%3.6%3.4%3.4%
17133.2%133.0%3.2%3.5%3.6%3.6%3.4%3.2%3.4%3.2%3.2%
18143.1%143.0%3.2%3.3%3.3%3.2%3.1%3.2%3.1%3.1%
19153.0%153.0%3.0%3.1%3.1%3.0%3.0%3.0%3.0%
20162.9%162.8%3.0%3.0%2.9%2.9%2.9%2.9%
21172.8%172.8%2.9%2.8%2.8%2.8%2.8%
22182.7%182.8%2.7%2.7%2.7%2.7%
23192.6%192.6%2.6%2.6%2.6%
24202.5%202.5%2.5%2.5%
25212.4%212.4%2.4%
26222.3%
Sheet1
Cell Formulas
RangeFormula
C5:C25C5=FILTER(G5:G26,(G5:G26<=C4))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
C4List=$H$4:$AC$4
 
As an addition to any of the above formula.....say I input 5 in C4, but then want the 1st % value (31%) to start from (say) the 4th (or any other) position?
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Can you give small set of sample data and expected results and explain again in relation to the sample data?
 
Upvote 0
Attached example.
Col D gives the %values corresponding to Col O for the selected integer in C3, using any of the above formulae.
Now I want to introduce a row offset value (G3) which gives the same output (Col H) but offsets the start point by the value G3. If G3 were 0, Col H equals Col D.

Cheers
 

Attachments

  • Example2.png
    Example2.png
    196.3 KB · Views: 17
Upvote 0
Col D gives ...

offset value (G3)
We can't see what is Col D or what id G3 ;)
Why not use XL2BB like you did before?

See if you can use (or adapt) this.

Ian McPherson.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABAC
1
2
3
4Select5%12345678910111213141516171819202122
5Offset3 1100.0%65.0%50.0%34.0%31.0%25.0%23.0%21.0%20.5%20.0%19.0%18.0%18.0%17.0%17.0%16.0%16.0%15.0%15.0%14.0%14.0%13.0%
6235.0%30.0%28.0%24.0%20.0%19.0%18.0%17.0%17.0%16.0%15.0%15.0%14.0%13.0%12.0%12.0%11.0%11.0%10.0%10.0%9.0%
7320.0%22.0%18.0%17.5%16.5%15.0%14.5%14.0%13.0%13.0%12.0%12.0%10.0%9.0%9.0%9.0%8.5%8.5%8.0%7.8%
8416.0%15.0%15.0%14.0%13.0%12.0%12.0%11.0%11.0%10.0%9.0%8.0%7.5%7.0%7.0%7.0%6.7%6.6%6.5%
931.0%512.0%12.5%11.5%11.0%10.0%10.0%9.5%9.5%8.0%8.0%7.0%7.0%6.5%6.5%6.3%6.2%6.0%6.0%
1024.0%610.0%9.0%9.0%8.0%8.0%8.0%8.0%7.0%7.0%6.4%6.5%6.0%6.0%5.8%5.7%5.5%5.5%
1118.0%77.0%7.0%7.0%5.5%6.5%6.5%6.0%5.8%5.9%6.0%5.5%5.5%5.3%5.2%5.0%5.0%
1215.0%86.0%6.0%5.0%5.5%5.0%5.0%4.9%5.4%5.5%5.0%5.0%4.9%4.7%4.6%4.6%
1312.0%95.0%4.5%4.5%4.0%4.6%4.5%5.0%5.0%4.7%4.6%4.5%4.4%4.2%4.2%
14104.0%3.8%3.6%4.2%4.2%4.6%4.6%4.4%4.3%4.1%4.1%3.9%3.9%
15113.2%3.3%3.8%3.9%4.2%4.3%4.2%4.0%3.8%3.8%3.6%3.6%
16123.1%3.4%3.5%3.8%3.9%3.9%3.7%3.5%3.6%3.4%3.4%
17133.0%3.2%3.5%3.6%3.6%3.4%3.2%3.4%3.2%3.2%
18143.0%3.2%3.3%3.3%3.2%3.1%3.2%3.1%3.1%
19153.0%3.0%3.1%3.1%3.0%3.0%3.0%3.0%
20162.8%3.0%3.0%2.9%2.9%2.9%2.9%
21172.8%2.9%2.8%2.8%2.8%2.8%
22182.8%2.7%2.7%2.7%2.7%
23192.6%2.6%2.6%2.6%
24202.5%2.5%2.5%
25212.4%2.4%
26222.3%
Extract Col (3)
Cell Formulas
RangeFormula
D5:D13D5=VSTACK(TEXTSPLIT(REPT("|",C5),,"|"),INDEX(H5:AC26,SEQUENCE(C4),C4))
Dynamic array formulas.
 
Upvote 0
Works well. Can the formula be tweaked for an offset of 0, rather than showing #Value!
 
Upvote 0
What about this then?

Ian McPherson.xlsm
ABCDEFGHIJKLMN
1
2
3
4Select5%1234567
5Offset0 1100.0%65.0%50.0%34.0%31.0%25.0%23.0%
6131.0%235.0%30.0%28.0%24.0%20.0%19.0%
7224.0%320.0%22.0%18.0%17.5%16.5%
8318.0%416.0%15.0%15.0%14.0%
9415.0%512.0%12.5%11.5%
10512.0%610.0%9.0%
11677.0%
1278
1389
1410
Extract Col (4)
Cell Formulas
RangeFormula
D5:D10D5=VSTACK(IFERROR(TEXTSPLIT(REPT("|",C5),,"|"),""),INDEX(H5:AC26,SEQUENCE(C4),C4))
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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