Compare value to non-linear list and perform calculation

JoeG

New Member
Joined
Nov 9, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have one I can't figure out in Excel. I have values 1-10 listed in A1-A10 then a list of non-linear numbers in cells B1-B10. I want to compare an input value in B11 to B1-B10 and calculate the fractional value from cells A1-A10. For example:

1500
2700
3850
41000
51500
Input ->875

A value of 875 should return a value of 3.16. Is there a function to look at the table and do this?
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi JoeG,

I'm not sure what you want for entered values below 500 or higher than the B column last number, but otherwise does this satisfy your need?

JoeG.xlsx
AB
1NumberValue
21500
32700
43850
541000
651500
76
87
98
109
1110
12Input->875
13Result->3.166667
Sheet1
Cell Formulas
RangeFormula
B13B13=INDEX($A$2:$A$11,MATCH($B$12,$B$2:$B$11,1))+(($B$12-INDEX($B$2:$B$11,MATCH($B$12,$B$2:$B$11,1)))/((INDEX($B$2:$B$11,(MATCH($B$12,$B$2:$B$11,1)+1))-(INDEX($B$2:$B$11,MATCH($B$12,$B$2:$B$11,1))))))
 
Upvote 0
Welcome to the MrExcel board!

Since you have MS365 you could also use the D2 formula below (if you have the LET function). If you do not have the LET function you could use D3.

21 11 10.xlsm
ABCD
11500875
227003.166667
338503.166667
441000
551500
662000
773000
884000
995000
10106000
Calc Fraction
Cell Formulas
RangeFormula
D2D2=XLOOKUP(D1,B1:B10,A1:A10,,-1)+LET(b,XLOOKUP(D1,B1:B10,B1:B10,,-1),IFERROR((D1-b)/(XLOOKUP(D1,B1:B10,B1:B10,,1)-b),0))
D3D3=XLOOKUP(D1,B1:B10,A1:A10,,-1)+IFERROR((D1-XLOOKUP(D1,B1:B10,B1:B10,,-1))/(XLOOKUP(D1,B1:B10,B1:B10,,1)-XLOOKUP(D1,B1:B10,B1:B10,,-1)),0)
 
Upvote 0
Solution
Hi JoeG,

I'm not sure what you want for entered values below 500 or higher than the B column last number, but otherwise does this satisfy your need?

JoeG.xlsx
AB
1NumberValue
21500
32700
43850
541000
651500
76
87
98
109
1110
12Input->875
13Result->3.166667
Sheet1
Cell Formulas
RangeFormula
B13B13=INDEX($A$2:$A$11,MATCH($B$12,$B$2:$B$11,1))+(($B$12-INDEX($B$2:$B$11,MATCH($B$12,$B$2:$B$11,1)))/((INDEX($B$2:$B$11,(MATCH($B$12,$B$2:$B$11,1)+1))-(INDEX($B$2:$B$11,MATCH($B$12,$B$2:$B$11,1))))))
Thanks. I was trying to make it simple to explain and your solution works for the information I provided. Actually my data set is in reverse order (10 to 0 on value) with progressively smaller numbers assigned from 10 to 0. When I apply this formula to my data I get #N/A return. I copied to a blank sheet and used the same data but in reverse order to verify. Ove of the other solutions below worked but I thank you for the reply
 
Upvote 0
Welcome to the MrExcel board!

Since you have MS365 you could also use the D2 formula below (if you have the LET function). If you do not have the LET function you could use D3.

21 11 10.xlsm
ABCD
11500875
227003.166667
338503.166667
441000
551500
662000
773000
884000
995000
10106000
Calc Fraction
Cell Formulas
RangeFormula
D2D2=XLOOKUP(D1,B1:B10,A1:A10,,-1)+LET(b,XLOOKUP(D1,B1:B10,B1:B10,,-1),IFERROR((D1-b)/(XLOOKUP(D1,B1:B10,B1:B10,,1)-b),0))
D3D3=XLOOKUP(D1,B1:B10,A1:A10,,-1)+IFERROR((D1-XLOOKUP(D1,B1:B10,B1:B10,,-1))/(XLOOKUP(D1,B1:B10,B1:B10,,1)-XLOOKUP(D1,B1:B10,B1:B10,,-1)),0)
D3 did the trick. Thank you!
 
Upvote 0
Actually my data set is in reverse order (10 to 0 on value) with progressively smaller numbers assigned from 10 to 0.
That is a significant difference so not much wonder suggestions fail to deliver. ;)


D3 did the trick. Thank you!
You're welcome. Glad it worked for you ... but given the above, that was pure luck! ?
 
Upvote 0

Forum statistics

Threads
1,214,615
Messages
6,120,538
Members
448,970
Latest member
kennimack

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