Find a value matching a range upon several criteria

ED38

New Member
Joined
Mar 29, 2024
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello,
I have hard time to to get the appropriate result with my formula so asking for your support :

In a list of data, each product has a cost associated upon a range of quantity at a certain date, I m looking for that associated cost as shown hereafter :

Book2
ABCDEFGHIJKLMN
1Qty rangeUnique listLastThe sought formual in a spilled way!
2product Update dateTIER (Low)TIER (High)Cost valueproduct QuantityUpdate dateNb of TiersCost ValueExpected values
3AAA01/10/23110010AAA25001/01/24322
4AAA01/10/2310150020AAB822/12/233130
5AAA01/10/23501200040AAC300103/09/2342750
6AAA01/01/24110012
7AAA01/01/2410150022
8AAA01/01/24501200042
9AAB21/09/23110120
10AAB21/09/2311100250
11AAB21/09/23101500350
12AAB22/12/23110130
13AAB22/12/2311100260
14AAB22/12/23101500360
15AAC03/06/2310500500
16AAC03/06/235011000750
17AAC03/06/23100125001100
18AAC03/06/232501100002500
19AAC03/09/2310400550
20AAC03/09/234011000825
21AAC03/09/23100130001210
22AAC03/09/233001120002750
23AAC24/05/2310450600
24AAC24/05/234511200900
25AAC24/05/23120135001320
26AAC24/05/233501150003000
27
Sheet2
Cell Formulas
RangeFormula
H3:H5H3=UNIQUE(A3:A26)
J3:J5J3=MAXIFS($B$3:$B$26,$A$3:$A$26,H3#)
K3:K5K3=COUNTIFS($A$3:$A$26,$H$3#,$B$3:$B$26,$J3#)
C4:C5,C24:C26,C20:C22,C16:C18,C13:C14,C10:C11,C7:C8C4=D3+1
E12:E14E12=E9+10
B9:B14B9=B3-10
B15:B16B15=B3-120
B17:B20B17=B4-120
B21:B24B21=B7-120
B25:B26B25=B10-120
E19:E22E19=E15*1.1
E23:E26E23=E15*1.2
Dynamic array formulas.


Thanks for your help
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hello, you could e.g. use:

Excel Formula:
=SUMIFS($E$3:$E$26,$A$3:$A$26,H3,$C$3:$C$26,"<="&I3,$D$3:$D$26,">="&I3,$B$3:$B$26,J3)

Excel Formula:
=FILTER($E$3:$E$26,($A$3:$A$26=H3)*($C$3:$C$26<=I3)*($D$3:$D$26>=I3)*($B$3:$B$26=J3))
 
Upvote 0
Solution
hello hagia_sofia,

Thank you for the quick response.
the 1st formula using SUMIFS works well even in a "spilled way" :
=SUMIFS($E$3:$E$26;$A$3:$A$26;H3#;$C$3:$C$26;"<="&I3:I5;$D$3:$D$26;">="&I3:I5;$B$3:$B$26;J3#)

whereas it does not with the FILTER formula so I validate the 1st one!
thanks a lot.
 
Upvote 0

Forum statistics

Threads
1,221,287
Messages
6,159,033
Members
451,533
Latest member
MCL_Playz

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