Find Closest Upper value with multiple criterias

Spartanjuli1

New Member
Joined
Sep 13, 2016
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I have a challenge for you :)
In the table below, I would like to have a formula (going from D5 to D19) which is giving me the closest upper "Total Hours" value when the C column is in state "TRUE".

Some formulas were tried, but it was always giving me B17 results instead of B14 cell.

  • Do you have any ideas ??


ABCD
1Total Years Total Hours
233650
3
4Total YearsTotal Hours"A5 <= $A$2 ?""Closest upper value $B$2"
521000TRUE
IF A5 <= $A$2 THEN return closest upper value WHERE (B2 <= B5:B19)
621500TRUEFALSE
722000TRUEFALSE
822400TRUEFALSE
923000TRUEFALSE
1031500TRUEFALSE
1132250TRUEFALSE
1233000TRUEFALSE
1333600TRUEFALSE
1434500TRUETRUE (because 4500 is the closest upper value to B2)
1542000FALSEFALSE
1643000FALSEFALSE
1743700FALSEFALSE
1844800FALSEFALSE
1946000FALSEFALSE

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>


Thank you a lot !
Julien

****** id="cke_pastebin" style="position: absolute; top: 318px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
IF A5 <= $A$2 THEN return closest upper value WHERE (B2 <= B5:B19)

<tbody>
</tbody>
</body>
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Use Ctrl+Shift+Enter to make an array formula. Put code in any cell.
Code:
=MAX(IF(C5:C19,B5:B19,""))
 
Upvote 0
If you wanted "True" or "False" all the way down Column D then:
Again Ctrl+Shift+Enter for array formula
Code:
{=IF(MAX(IF(C5:C19,B5:B19,""))=B5, "TRUE", "FALSE")}
 
Upvote 0
Hello,

Thank you for the answer, unfortunately I believe I was not maybe accurate enough:

Cells D5 to D19 should have the formula.

I want to have in cell D5 the value "TRUE" or "FALSE" when there are multiple criteria fulfilled:

#1 : A5<=&A&3 (A5 will be for cell D5, A6 for D6 until D19)
AND
#2 - when criteria #1 returning a value "TRUE", look up for the the closest Higher value from cells $B$5:$B$19.
At the end, if column A fulfils criteria, then look in the rows from column B where A rows fulfills the criteria and return the value where both conditions are met.


maybe with the real example from table above:
Using the table above, D14 should return ONLY "TRUE" value when A14 < $A$5 (3 <= 3) AND when B14 (4500) is the closest upper value to $B$2 (3650)
The trick here is that B17 (3700) value is the closest value to $B$2 (3650) but not A17 (4) as it is higher than $A$2 (3)

Results should look like the table above and I am a bit lost on that :(

Thank you !
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,462
Members
449,085
Latest member
ExcelError

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