Formula suggestions (Index/match, lookup, or other)

tt1995

New Member
Joined
Oct 11, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi guys!

I am trying to find a formula that allows me to match/insert the Batch size from column "J" to column "D", while:
  • Matching the Product (column "B" = "G"), and
  • Batch size being larger in column "C" than in "H"
Example 1: Product A; Order QTY = 10 280 --> Batch size 2/3
Example 2: Product A; Order QTY = 5 001 --> Batch size 1/3

Later I would like to insert COGs from column "I" to "E" (matched as above) as well.

Capture.PNG


I have tried formulas such as the different lookups and match/index but without success. Very thankful for suggestions!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
MrExcelPlayground12.xlsx
BCDEFGHIJ
2ProductsOrder QtyBatch SizeCOGsProductsOrder QtyCOGsBatch Size
3A102802/327A5000201/3
4A50011/320A10000272/3
5A69981/320A30000313/3
6A778#N/AB5000111/3
7A297362/327B10000162/3
8A101972/327B30000203/3
9B77761/311C50001001/3
10B619923/320C100001302/3
11B229292/316C270001503/3
12B140072/316D500031/3
13B4643#N/AD1000042/3
14C518133/3150D2500053/3
15C199372/3130
16C877693/3150
Sheet29
Cell Formulas
RangeFormula
D14:E16,D7:E12,D6,D13,D3:E5D3=VLOOKUP(C3,FILTER($H$3:$J$14,$G$3:$G$14=B3),{3,2},TRUE)
Dynamic array formulas.
 
Upvote 0
Solution
try this out
------------
index match round.xlsx
BCDEFGHIJ
2ProductOrder QTYBatch SizeCOGsProductOrder QTYCOGsBatch Size
3Product A102802/327Product A5000201/3
4Product A105302/327Product A10000272/3
5Product A50011/320Product A30000311
6Product A7781/320Product B5000111/3
7Product A297362/327Product B10000162/3
8Product A101972/327Product B30000201
9Product B77761/311Prodcut C50001001/3
10Product B61992120Prodcut C100001302/3
11Product B229292/316Prodcut C270001501
12Product B140072/316Product D500031/3
13Product B46431/311Product D1000042/3
14Product B51813120Product D2500051
15Product B199372/316
16Prodcut C877691150
17Prodcut C101522/3130
18Prodcut C129212/3130
19Prodcut C262142/3130
20Prodcut C226802/3130
21Prodcut C30241/3100
22Product D3084215
23Product D3055715
24Product D90721/33
25Product D95041/33
26Product D95041/33
27Product D2610615
28Product D2592015
29Product E9072  
30Product E25056  
31Product E5400  
32Product E9936  
33Product E10152  
34Product E10152  
Sheet1
Cell Formulas
RangeFormula
D3:D34D3=IFERROR(INDEX($J$3:$J$100,MATCH(1,([@Product]=$G$3:$G$100)*(IF(MAX(IF(FILTER($H$3:$H$100, [@Product]=$G$3:$G$100)<[@[Order QTY]],FILTER($H$3:$H$100, [@Product]=$G$3:$G$100)))=0,MIN(FILTER($H$3:$H$100, [@Product]=$G$3:$G$100)),MAX(IF(FILTER($H$3:$H$100, [@Product]=$G$3:$G$100)<[@[Order QTY]],FILTER($H$3:$H$100, [@Product]=$G$3:$G$100))))=$H$3:$H$100),0)),"")
E3:E34E3=IFERROR(INDEX($I$3:$I$100,MATCH(1,([@Product]=$G$3:$G$100)*([@[Batch Size]]=$J$3:$J$100),0)),"")
 
Upvote 0
MrExcelPlayground12.xlsx
BCDEFGHIJ
2ProductsOrder QtyBatch SizeCOGsProductsOrder QtyCOGsBatch Size
3A102802/327A5000201/3
4A50011/320A10000272/3
5A69981/320A30000313/3
6A778#N/AB5000111/3
7A297362/327B10000162/3
8A101972/327B30000203/3
9B77761/311C50001001/3
10B619923/320C100001302/3
11B229292/316C270001503/3
12B140072/316D500031/3
13B4643#N/AD1000042/3
14C518133/3150D2500053/3
15C199372/3130
16C877693/3150
Sheet29
Cell Formulas
RangeFormula
D14:E16,D7:E12,D6,D13,D3:E5D3=VLOOKUP(C3,FILTER($H$3:$J$14,$G$3:$G$14=B3),{3,2},TRUE)
Dynamic array formulas.
Very smooth - thanks a lot!
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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