Hi,
Given a fixed matrix of values, i need a way to calculate the value in that matrix that is closest to a specified number, but always higher than this one.
I hope the excel file will clear things up!
Thanks
Hi,
Given a fixed matrix of values, i need a way to calculate the value in that matrix that is closest to a specified number, but always higher than this one.
I hope the excel file will clear things up!
Thanks
Use SMALL with COUNTIF
=IF(MAX($K$5:$N$11)<=$F$6;"No Values";SMALL($K$5:$N$11;1+COUNTIF($K$5:$N$11;"<="&$F$6)))
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Try this comfirmed with ctrl+shift+enter
=F6/MAX(IF(F6/K5:N11<1;F6/K5:N11))
Edit: I'm lateGreat solution DO!
Last edited by zbor; 09-04-2010 at 10:43 AM.
Never use Merged Cells in Excel
thank you very much both of you![]()
i'm sorry...just one more thing...how can I determine the relative position of the value found? I tried hlookup and vlookup but they're not working![]()
I'm not sure that this is best way... but working for now...
I generally look to return the "co-ordinates" in a single cell and then if nec. create an Address from the co-ordinates rather than dupe what is in reality an expensive approach
F9:
=MIN(IF(K5:N11=F8,J5:J11+((COLUMN(K5:N5)-COLUMN(K5)+1)/1000000)))
confirmed with CTRL + SHIFT + ENTER
which would return 4.000002
F10:
=INT(F9)&INDEX(K4:N4,ROUND(MOD(F9,1)*1000000,0))
which would return 4B
coaster, note I posted with incorrect delimiters for you - modify the , to ; as required.
I also took advantage of J5:J11 holding 1 to 7 ... if that were not the case eg A:G and you wanted to return DB rather than 4B then you would use:
![]()
F9: =MIN(IF(K5:N11=F8;ROW(K5:K11)-ROW(J5)+1+((COLUMN(K5:N5)-COLUMN(K5)+1)/1000000))) confirmed with CTRL + SHIFT + ENTER F10: =INDEX(J5:J11;INT(F9))&INDEX(K4:N4;ROUND(MOD(F9;1)*1000000;0))
that's perfect! thank you very very much![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks