Combine all products with different varieties

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
Hello,</SPAN></SPAN>

Combine all products with different varieties to achieve a special offer price package </SPAN></SPAN>

I am looking for a solution on how many special offer price packages can be prepared from the product and variety list of D5:F12, Note: there is Product A To H & Variety X To Z in the offer packages there must be all Products present from A To H one of each, but only one variety price can be chosen from X to Z </SPAN></SPAN>

Here are a few examples...</SPAN></SPAN>
Column H if we make a lowest price offer package than we can pick the lowest price of one variety product and then combine it with one of each product A to H which can be the 135 $</SPAN></SPAN>

Column J if we make a highest price offer package than we can pick the highest price of one variety product and than combine picking one of each product A to H which can be the 476 $</SPAN></SPAN>

Made some offer price packages in Columns L, N, P, R, T and Y, question is how many special offer price packages can be prepared? Or in the range say 135$ to 199, 200$ to 299$, 300$ to 399$ or 400$ to 476$ may be?</SPAN></SPAN>

Below is shown example data...</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRSTUV
1
2Min Offer PackageMax Offer PackageOffer PackageOffer PackageOffer PackageOffer PackageOffer PackageOffer Package
3Variety XVariety YVariety ZPrice $Price $Price $Price $Price $Price $Price $Price $
4Price $Price $Price $135476157212243311334392
5Product A9137897813978787878
6Product B2334432343232343232323
7Product C5841158451111111184
8Product D5926151559262615592659
9Product E1220681268121212686820
10Product F2733402740272740272727
11Product G3332353235323532333232
12Product H1269191269196912126969
Sheet2


Thanks In Advance </SPAN></SPAN>
Using version 2000</SPAN></SPAN>

Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
 
Last edited:
Maybe this macro...

Code:
Sub aTest()
    Dim pa As Variant, pb As Variant, pc As Variant, pd As Variant
    Dim pe As Variant, pf As Variant, pg As Variant, ph As Variant
    Dim i As Long, j As Long, k As Long, l As Long
    Dim m As Long, n As Long, o As Long, p As Long
    Dim myArr(1 To 8), dic As Object, lInd As Long
    
    pa = Range("D5:F5")
    pb = Range("D6:F6")
    pc = Range("D7:F7")
    pd = Range("D8:F8")
    pe = Range("D9:F9")
    pf = Range("D10:F10")
    pg = Range("D11:F11")
    ph = Range("D12:F12")
    
    Set dic = CreateObject("Scripting.Dictionary")
    lInd = 4
    For i = 1 To 3
      For j = 1 To 3
        For k = 1 To 3
          For l = 1 To 3
            For m = 1 To 3
              For n = 1 To 3
                For o = 1 To 3
                  For p = 1 To 3
                    myArr(1) = pa(1, i)
                    myArr(2) = pb(1, j)
                    myArr(3) = pc(1, k)
                    myArr(4) = pd(1, l)
                    myArr(5) = pe(1, m)
                    myArr(6) = pf(1, n)
                    myArr(7) = pg(1, o)
                    myArr(8) = ph(1, p)
                    lInd = lInd + 1
                    dic(lInd) = myArr
                  Next p
                Next o
              Next n
            Next m
          Next l
        Next k
      Next j
    Next i
    
    Range("I5").Resize(dic.Count, 8) = Application.Transpose(Application.Transpose(dic.items))
    With Range("Q5:Q" & lInd)
        .Formula = "=SUM(I5:P5)"
        .Value = .Value
    End With
    'Optional - sort ascending
    SortResults lInd
End Sub

Sub SortResults(lr As Long)
    Range("I4:Q" & lr).Sort key1:=Range("Q4"), order1:=xlAscending, Header:=xlYes
End Sub

Hope this helps

M.
 
Upvote 0

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).
Maybe this macro...

Code:
Sub aTest()
    Dim pa As Variant, pb As Variant, pc As Variant, pd As Variant
    Dim pe As Variant, pf As Variant, pg As Variant, ph As Variant
    Dim i As Long, j As Long, k As Long, l As Long
    Dim m As Long, n As Long, o As Long, p As Long
    Dim myArr(1 To 8), dic As Object, lInd As Long
    
    pa = Range("D5:F5")
    pb = Range("D6:F6")
    pc = Range("D7:F7")
    pd = Range("D8:F8")
    pe = Range("D9:F9")
    pf = Range("D10:F10")
    pg = Range("D11:F11")
    ph = Range("D12:F12")
    
    Set dic = CreateObject("Scripting.Dictionary")
    lInd = 4
    For i = 1 To 3
      For j = 1 To 3
        For k = 1 To 3
          For l = 1 To 3
            For m = 1 To 3
              For n = 1 To 3
                For o = 1 To 3
                  For p = 1 To 3
                    myArr(1) = pa(1, i)
                    myArr(2) = pb(1, j)
                    myArr(3) = pc(1, k)
                    myArr(4) = pd(1, l)
                    myArr(5) = pe(1, m)
                    myArr(6) = pf(1, n)
                    myArr(7) = pg(1, o)
                    myArr(8) = ph(1, p)
                    lInd = lInd + 1
                    dic(lInd) = myArr
                  Next p
                Next o
              Next n
            Next m
          Next l
        Next k
      Next j
    Next i
    
    Range("I5").Resize(dic.Count, 8) = Application.Transpose(Application.Transpose(dic.items))
    With Range("Q5:Q" & lInd)
        .Formula = "=SUM(I5:P5)"
        .Value = .Value
    End With
    'Optional - sort ascending
    SortResults lInd
End Sub

Sub SortResults(lr As Long)
    Range("I4:Q" & lr).Sort key1:=Range("Q4"), order1:=xlAscending, Header:=xlYes
End Sub

Hope this helps

M.
Marcelo Branco, :pray: I am very gratefully to you for looking my request and providing a VBA solution I really appreciate it. I was desperate needed to have it. </SPAN></SPAN>

I am sure it is because of version 2000, code stuck at the line below. Please could you take a look?
</SPAN></SPAN>
Code:
 Range("I5").Resize(dic.Count, 8) = Application.Transpose(Application.Transpose(dic.items))
</SPAN></SPAN>
Thank you very much
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>
 
Upvote 0
See if this new version works in Excel 2000

Code:
Sub aTestV2()
    Dim pa As Variant, pb As Variant, pc As Variant, pd As Variant
    Dim pe As Variant, pf As Variant, pg As Variant, ph As Variant
    Dim i As Long, j As Long, k As Long, l As Long
    Dim m As Long, n As Long, o As Long, p As Long
    Dim myArr(1 To 8), lLin As Long
    
    pa = Range("D5:F5")
    pb = Range("D6:F6")
    pc = Range("D7:F7")
    pd = Range("D8:F8")
    pe = Range("D9:F9")
    pf = Range("D10:F10")
    pg = Range("D11:F11")
    ph = Range("D12:F12")
    
    lLin = 4
    For i = 1 To 3
      For j = 1 To 3
        For k = 1 To 3
          For l = 1 To 3
            For m = 1 To 3
              For n = 1 To 3
                For o = 1 To 3
                  For p = 1 To 3
                    myArr(1) = pa(1, i)
                    myArr(2) = pb(1, j)
                    myArr(3) = pc(1, k)
                    myArr(4) = pd(1, l)
                    myArr(5) = pe(1, m)
                    myArr(6) = pf(1, n)
                    myArr(7) = pg(1, o)
                    myArr(8) = ph(1, p)
                    lLin = lLin + 1
                    Range("I" & lLin).Resize(, 8) = myArr
                  Next p
                Next o
              Next n
            Next m
          Next l
        Next k
      Next j
    Next i
    
    With Range("Q5:Q" & lLin)
        .Formula = "=SUM(I5:P5)"
        .Value = .Value
    End With
    'Optional - sort ascending
    SortResults lLin
End Sub

Sub SortResults(lr As Long)
    Range("I4:Q" & lr).Sort key1:=Range("Q4"), order1:=xlAscending, Header:=xlYes
End Sub

M.
 
Upvote 0
See if this new version works in Excel 2000

Code:
Sub aTestV2()
    Dim pa As Variant, pb As Variant, pc As Variant, pd As Variant
    Dim pe As Variant, pf As Variant, pg As Variant, ph As Variant
    Dim i As Long, j As Long, k As Long, l As Long
    Dim m As Long, n As Long, o As Long, p As Long
    Dim myArr(1 To 8), lLin As Long
    
    pa = Range("D5:F5")
    pb = Range("D6:F6")
    pc = Range("D7:F7")
    pd = Range("D8:F8")
    pe = Range("D9:F9")
    pf = Range("D10:F10")
    pg = Range("D11:F11")
    ph = Range("D12:F12")
    
    lLin = 4
    For i = 1 To 3
      For j = 1 To 3
        For k = 1 To 3
          For l = 1 To 3
            For m = 1 To 3
              For n = 1 To 3
                For o = 1 To 3
                  For p = 1 To 3
                    myArr(1) = pa(1, i)
                    myArr(2) = pb(1, j)
                    myArr(3) = pc(1, k)
                    myArr(4) = pd(1, l)
                    myArr(5) = pe(1, m)
                    myArr(6) = pf(1, n)
                    myArr(7) = pg(1, o)
                    myArr(8) = ph(1, p)
                    lLin = lLin + 1
                    Range("I" & lLin).Resize(, 8) = myArr
                  Next p
                Next o
              Next n
            Next m
          Next l
        Next k
      Next j
    Next i
    
    With Range("Q5:Q" & lLin)
        .Formula = "=SUM(I5:P5)"
        .Value = .Value
    End With
    'Optional - sort ascending
    SortResults lLin
End Sub

Sub SortResults(lr As Long)
    Range("I4:Q" & lr).Sort key1:=Range("Q4"), order1:=xlAscending, Header:=xlYes
End Sub

M.
Marcelo Branco, hats off to you this worked spot on, it generated total 6561 lines starting from minimum sum 135 to maximum 476 Perfectly! <o:p></o:p>
<o:p></o:p>
I appreciate your time taken to solve my request. :beerchug:<o:p></o:p>
<o:p></o:p>
Could it be possible, instead of generating all minimum to maximum can we limit the range of sum. For example: generate 200 to 250 or any other range I can select from 135-476.<o:p></o:p>
<o:p></o:p>
Kind Regards,<o:p></o:p>
Moti :-D<o:p></o:p>
 
Upvote 0
You are welcome. Glad to help.
To select specific sum ranges try filtering the result

M.
 
Upvote 0
You are welcome. Glad to help.
M.
Marcelo Branco, I am very happy with your code it has saved my lot of time and it has been very useful for my job work :-D
To select specific sum ranges try filtering the result
M.
Yes I tried as you said and got the required range filtered, to avoid this step I thought might be it could be restricted the range directly inside the code it self if not possible I am very much happy with current code solution </SPAN></SPAN>

Thank you once again for your replay
</SPAN></SPAN>

I hope you have a great week
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>:)
 
Upvote 0
To filter the results (after you have run the aTestV2 macro) try:
Assumes:
Data on Sheet1
Filtered Results in Sheet2

Sheet1
Criteria in A2: B2

[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Lower​
[/TD]
[TD]
Higher​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
200​
[/TD]
[TD]
250
[/TD]
[/TR]
</tbody>[/TABLE]


Leave S4 empty and insert this formula in S5
=AND(Q5>=$A$2,Q5<=$B$2)

[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
S
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
FALSE​
[/TD]
[/TR]
</tbody>[/TABLE]


Run this macro
Code:
Sub AdvFilter()
    Sheets("Sheet2").Activate
    Columns("A:I").ClearContents
    Sheets("Sheet1").Range("I4:Q6565").AdvancedFilter Action:=xlFilterCopy, _
        CriteriaRange:=Sheets("Sheet1").Range("S4:S5"), CopyToRange:=Range("A1"), _
        Unique:=False
End Sub

M.
 
Upvote 0
To filter the results (after you have run the aTestV2 macro) try:
Assumes:
Data on Sheet1
Filtered Results in Sheet2

Sheet1
Criteria in A2: B2

[TABLE="class: grid"]
<TBODY>[TR]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "]
A
[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "]
B
[/TD]
[/TR]
[TR]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "]
1
[/TD]
[TD]
Lower​
[/TD]
[TD]
Higher​
[/TD]
[/TR]
[TR]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "]
2
[/TD]
[TD]
200​
[/TD]
[TD]
250
[/TD]
[/TR]
</TBODY>[/TABLE]


Leave S4 empty and insert this formula in S5
=AND(Q5>=$A$2,Q5<=$B$2)

[TABLE="class: grid"]
<TBODY>[TR]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "]
S
[/TD]
[/TR]
[TR]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "]
4
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=dce6f1]#dce6f1[/URL] "]
5
[/TD]
[TD]
FALSE​
[/TD]
[/TR]
</TBODY>[/TABLE]


Run this macro
Code:
Sub AdvFilter()
    Sheets("Sheet2").Activate
    Columns("A:I").ClearContents
    Sheets("Sheet1").Range("I4:Q6565").AdvancedFilter Action:=xlFilterCopy, _
        CriteriaRange:=Sheets("Sheet1").Range("S4:S5"), CopyToRange:=Range("A1"), _
        Unique:=False
End Sub

M.
Marcelo Branco, I set the sheets as per your instructions and (after running the aTestV2 macro) I run AdvFilter macro it does not filter the range 200-250 as pre A2-B2 but it do copy all the result in the sheet2 with all sums starting A1 To I6562 I can't find what I am doing wrong. </SPAN></SPAN>

Do you have some suggestions?
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti
</SPAN></SPAN>
 
Upvote 0
Criteria in A2: B2 of Sheet1 (data sheet)
Did you insert the formula in S5 and leave S4 empty?

Worked perfectly for me - see below some results (i did not paste all rows..)

Sheet2

[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[TD="bgcolor: #DCE6F1"]
F
[/TD]
[TD="bgcolor: #DCE6F1"]
G
[/TD]
[TD="bgcolor: #DCE6F1"]
H
[/TD]
[TD="bgcolor: #DCE6F1"]
I
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Product A​
[/TD]
[TD]
Product B​
[/TD]
[TD]
Product C​
[/TD]
[TD]
Product D​
[/TD]
[TD]
Product E​
[/TD]
[TD]
Product F​
[/TD]
[TD]
Product G​
[/TD]
[TD]
Product H​
[/TD]
[TD]
Package Price​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
40​
[/TD]
[TD]
33​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
32​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
32​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
32​
[/TD]
[TD]
69​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
68​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
32​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
8
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
33​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
9
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
15​
[/TD]
[TD]
68​
[/TD]
[TD]
27​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
10
[/TD]
[TD]
9​
[/TD]
[TD]
34​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
27​
[/TD]
[TD]
35​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
11
[/TD]
[TD]
9​
[/TD]
[TD]
43​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
27​
[/TD]
[TD]
33​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
12
[/TD]
[TD]
9​
[/TD]
[TD]
43​
[/TD]
[TD]
11​
[/TD]
[TD]
26​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
32​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
13
[/TD]
[TD]
13​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
14
[/TD]
[TD]
13​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
15
[/TD]
[TD]
13​
[/TD]
[TD]
34​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
33​
[/TD]
[TD]
32​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
16
[/TD]
[TD]
13​
[/TD]
[TD]
34​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
27​
[/TD]
[TD]
32​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
17
[/TD]
[TD]
13​
[/TD]
[TD]
43​
[/TD]
[TD]
11​
[/TD]
[TD]
26​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
18
[/TD]
[TD]
13​
[/TD]
[TD]
43​
[/TD]
[TD]
11​
[/TD]
[TD]
26​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
19
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
33​
[/TD]
[TD]
19​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
20
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
33​
[/TD]
[TD]
12​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
21
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
12​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
69​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
22
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
33​
[/TD]
[TD]
69​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
23
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[/TR]
</tbody>[/TABLE]


M.
 
Upvote 0
Solution
Criteria in A2: B2 of Sheet1 (data sheet)
Did you insert the formula in S5 and leave S4 empty?

Worked perfectly for me - see below some results (i did not paste all rows..)

Sheet2

[TABLE="class: grid"]
<TBODY>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[TD]
H
[/TD]
[TD]
I
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]
Product A​
[/TD]
[TD]
Product B​
[/TD]
[TD]
Product C​
[/TD]
[TD]
Product D​
[/TD]
[TD]
Product E​
[/TD]
[TD]
Product F​
[/TD]
[TD]
Product G​
[/TD]
[TD]
Product H​
[/TD]
[TD]
Package Price​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
40​
[/TD]
[TD]
33​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
32​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
32​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
32​
[/TD]
[TD]
69​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
68​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
32​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
8
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
33​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
9
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
15​
[/TD]
[TD]
68​
[/TD]
[TD]
27​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
10
[/TD]
[TD]
9​
[/TD]
[TD]
34​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
27​
[/TD]
[TD]
35​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
11
[/TD]
[TD]
9​
[/TD]
[TD]
43​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
27​
[/TD]
[TD]
33​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
12
[/TD]
[TD]
9​
[/TD]
[TD]
43​
[/TD]
[TD]
11​
[/TD]
[TD]
26​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
32​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
13
[/TD]
[TD]
13​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
14
[/TD]
[TD]
13​
[/TD]
[TD]
23​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
15
[/TD]
[TD]
13​
[/TD]
[TD]
34​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
33​
[/TD]
[TD]
32​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
16
[/TD]
[TD]
13​
[/TD]
[TD]
34​
[/TD]
[TD]
11​
[/TD]
[TD]
59​
[/TD]
[TD]
12​
[/TD]
[TD]
27​
[/TD]
[TD]
32​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
17
[/TD]
[TD]
13​
[/TD]
[TD]
43​
[/TD]
[TD]
11​
[/TD]
[TD]
26​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
19​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
18
[/TD]
[TD]
13​
[/TD]
[TD]
43​
[/TD]
[TD]
11​
[/TD]
[TD]
26​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
35​
[/TD]
[TD]
12​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD]
19
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
33​
[/TD]
[TD]
33​
[/TD]
[TD]
19​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD]
20
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
59​
[/TD]
[TD]
20​
[/TD]
[TD]
40​
[/TD]
[TD]
33​
[/TD]
[TD]
12​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD]
21
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
12​
[/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
69​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD]
22
[/TD]
[TD]
9​
[/TD]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
15​
[/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
33​
[/TD]
[TD]
69​
[/TD]
[TD]
201​
[/TD]
[/TR]
[TR]
[TD]
23
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[TD]
....​
[/TD]
[/TR]
</TBODY>[/TABLE]


M.
Marcelo Branco, some thing went wrong I just restart all again and create a new workbook all worked perfectly as you illustrate.</SPAN></SPAN>

Marcelo, I am very sorry for the inconvenience, thank you for your advance filter idea which is innovative I like it.
</SPAN></SPAN>

Good Luck have a good day
</SPAN></SPAN>

Kind Regards,
</SPAN></SPAN>
Moti :-D
</SPAN></SPAN>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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