Excel MVP needed! Please help with an (Aggregate) RANK

collegeitdept

Board Regular
Joined
Nov 14, 2008
Messages
185
I have a sample workbook (attached by link) that has 5 worksheets of raw data. Column A contains dates (9/3/2013 - 10/24/2013). column headers are categories/variables (ie: sales, units, etc...)

I need a formula that will will give the me the rank for a date (10/24/2013) of of all the aggregate "sales" columns from the 5 worksheets please???


https://dl.dropboxusercontent.com/u/15717201/Excel Question.xlsx

(Caveats... It cannot be broken down into 2 steps... i can't add columns)


An Excel MVP is needed please.
 
Last edited:
I've just downloaded your new file.

You can use a shorter formula in I8, J8 and K8

Create a named range Sheets like this


[TABLE="class: grid"]
<TBODY>[TR]
[TD][/TD]
[TD]
O
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
Platform 1​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
Platform 2​
[/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
Platform 3​
[/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
Platform 4​
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
Platform 5​
[/TD]
[/TR]
</TBODY>[/TABLE]


Then you can use in
I8
=SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!B:B")))
copy down

J8
=SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!C:C")))
copy down

K8
=SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!D:D")))

------------------------------------------------------------------------------------------------
I'm not sure what you mean by
"rank "7" against entire 'Sales' column from each worksheet"

Do you want to compare 7 against each row in column Sales from each worksheet?
-----------------------------------------------------------------------------------------------

If so, without helper columns, **maybe** (not fully tested) this can work

D8
=SUMPRODUCT(--(SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!B:B")))>'Platform 1'!B$2:B$1000),--('Platform 1'!B$2:B$1000<>""))+SUMPRODUCT(--(SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!B:B")))>'Platform 2'!B$2:B$1000),--('Platform 2'!B$2:B$1000<>""))
copy down

E8
=SUMPRODUCT(--(SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!C:C")))>'Platform 1'!C$2:C$1000),--('Platform 1'!C$2:C$1000<>""))+SUMPRODUCT(--(SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!C:C")))>'Platform 2'!C$2:C$1000),--('Platform 2'!C$2:C$1000<>""))
copy down

F8
=SUMPRODUCT(--(SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!D:D")))>'Platform 1'!D$2:D$1000),--('Platform 1'!D$2:D$1000<>""))+SUMPRODUCT(--(SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!D:D")))>'Platform 2'!D$2:D$1000),--('Platform 2'!D$2:D$1000<>""))
copy down


These formulae do comparisons only against Platform 1 and Platform 2.

Using them I get


[TABLE="class: grid"]
<TBODY>[TR]
[TD][/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
Aggregate​
[/TD]
[TD]
Rank​
[/TD]
[TD]
Rank​
[/TD]
[TD]
Rank​
[/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]
Date​
[/TD]
[TD]
Sales​
[/TD]
[TD]
Units​
[/TD]
[TD]
Palettes​
[/TD]
[/TR]
[TR]
[TD]
8
[/TD]
[TD]
14/10/2013​
[/TD]
[TD]
225​
[/TD]
[TD]
229​
[/TD]
[TD]
269​
[/TD]
[/TR]
[TR]
[TD]
9
[/TD]
[TD]
15/10/2013​
[/TD]
[TD]
277​
[/TD]
[TD]
261​
[/TD]
[TD]
222​
[/TD]
[/TR]
[TR]
[TD]
10
[/TD]
[TD]
16/10/2013​
[/TD]
[TD]
233​
[/TD]
[TD]
211​
[/TD]
[TD]
0​
[/TD]
[/TR]
[TR]
[TD]
11
[/TD]
[TD]
17/10/2013​
[/TD]
[TD]
249​
[/TD]
[TD]
232​
[/TD]
[TD]
204​
[/TD]
[/TR]
[TR]
[TD]
12
[/TD]
[TD]
18/10/2013​
[/TD]
[TD]
136​
[/TD]
[TD]
211​
[/TD]
[TD]
102​
[/TD]
[/TR]
[TR]
[TD]
13
[/TD]
[TD]
19/10/2013​
[/TD]
[TD]
269​
[/TD]
[TD]
211​
[/TD]
[TD]
232​
[/TD]
[/TR]
[TR]
[TD]
14
[/TD]
[TD]
20/10/2013​
[/TD]
[TD]
267​
[/TD]
[TD]
239​
[/TD]
[TD]
257​
[/TD]
[/TR]
[TR]
[TD]
15
[/TD]
[TD]
21/10/2013​
[/TD]
[TD]
206​
[/TD]
[TD]
194​
[/TD]
[TD]
204​
[/TD]
[/TR]
[TR]
[TD]
16
[/TD]
[TD]
22/10/2013​
[/TD]
[TD]
206​
[/TD]
[TD]
194​
[/TD]
[TD]
232​
[/TD]
[/TR]
[TR]
[TD]
17
[/TD]
[TD]
23/10/2013​
[/TD]
[TD]
218​
[/TD]
[TD]
231​
[/TD]
[TD]
102​
[/TD]
[/TR]
[TR]
[TD]
18
[/TD]
[TD]
24/10/2013​
[/TD]
[TD]
254​
[/TD]
[TD]
211​
[/TD]
[TD]
243​
[/TD]
[/TR]
</TBODY>[/TABLE]


You can include the other 3 sheets adding on each formula
+SUMPRODUCT(--(SUMPRODUCT(.........)>'Platform3'!$C$2:$C$1000), --(Platform3!$C$2:$C$1000<>"")) + .... +.....

Hope this helps

M.
 
Last edited:
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You can include the other 3 sheets adding on each formula
+SUMPRODUCT(--(SUMPRODUCT(.........)>'Platform3'!$C$2:$C$1000), --(Platform3!$C$2:$C$1000<>"")) + .... +.....

This is an example for formula in E8, i.e., for calculating Units (data in column C on each sheet)

For D8 (Sales) and F8 (Palettes) you must adjust the ranges, respectively, to $B$2:$B$1000 and $D$2:$D$1000

M.
 
Upvote 0
I can make a solution using a User Defined Function and named ranges. Its a two step solution, which requires just one formula per step, regardless of how many types of categories you wish to sum.

This is not exactly what the op wanted so if an MVP has a better solution please share. But it does actually do the job quite well I think. The advantage of this system is can handle as many worksheets you want and as many field categories as you want. So if you later add more worksheets the UDF will still work (provided you update your named ranges).

The OP might not have a use for this (although I think it does solve his problem), but I learned a lot figuring it out, and will no doubt I will use something like this myself for work problems.

The values are summed on one page (which may be hidden if you require), and then ranked on your summary page.

This file illustrates (I hope people can access this).

https://www.dropbox.com/s/f8pezlfbj8012q2/Excel Question - Test Solution with VBA.xlsm

You need to create a lot of named ranges, each category (Sales, Units etc) * each worksheet (eg Platform 1, Platform 2, Platform 3 etc)

Each is a sample of the named ranges (the p prefix stands for "Platform" as per the OPs sample workbook).

[TABLE="width: 485"]
<tbody>[TR]
[TD]p1.Date[/TD]
[TD]='Platform 1'!$A$2:$A$143[/TD]
[/TR]
[TR]
[TD]p1.Palettes[/TD]
[TD]='Platform 1'!$E$2:$E$143[/TD]
[/TR]
[TR]
[TD]p1.Sales[/TD]
[TD]='Platform 1'!$C$2:$C$143[/TD]
[/TR]
[TR]
[TD]p1.Units[/TD]
[TD]='Platform 1'!$D$2:$D$143[/TD]
[/TR]
[TR]
[TD]p2.Date[/TD]
[TD]='Platform 2'!$A$2:$A$143[/TD]
[/TR]
[TR]
[TD]p2.Palettes[/TD]
[TD]='Platform 2'!$E$2:$E$143[/TD]
[/TR]
[TR]
[TD]p2.Sales[/TD]
[TD]='Platform 2'!$C$2:$C$143
[/TD]
[/TR]
[TR]
[TD]p2.Units[/TD]
[TD]='Platform 2'!$D$2:$D$143[/TD]
[/TR]
</tbody>[/TABLE]

To speed up the process of making the name ranges I have written a macro. This macro needs to reference two other named ranges which I suggest you store on an additional worksheet called "Names"
Create two named ranges to get started "MySheets" and "MyFields". If you don't know how to make named ranges Google it or post back here and I can give you more instructions.
MySheets - which list all of the worksheet names containing the data you wish to aggregate (be careful to get worksheet names exactly right).
MyFields - which lists all of the fields (these must be correct too)

For example:
[TABLE="width: 485"]
<tbody>[TR]
[TD]MyFields[/TD]
[TD]=Names!$B$1:$B$4[/TD]
[/TR]
[TR]
[TD]MySheets[/TD]
[TD]=Names!$A$1:$A$5[/TD]
[/TR]
</tbody>[/TABLE]


This is the macro which creates the names (it won't work until you have created and populated MySheets and MyFields. This is faster than creating them manually.
Code:
Sub CreateNamedRanges()
Dim ws As Worksheet
Dim MyRng As Range, MyRng2 As Range, MyRngC As Range
Dim SheetNames(), FieldNames(), cntSheets As Integer, cntFields As Integer
Dim ColNum As Integer
Dim strName As String

SheetNames = Application.Transpose([MySheets].Value)
FieldNames = Application.Transpose([MyFields].Value)

For cntSheets = LBound(SheetNames) To UBound(SheetNames)
MsgBox SheetNames(cntSheets)

    Set ws = Worksheets(SheetNames(cntSheets))
    Set MyRng = ws.Range("A1").CurrentRegion
    Set MyRng2 = MyRng.Offset(1, 0).Resize(MyRng.Rows.Count - 1)

    For cntFields = LBound(FieldNames) To UBound(FieldNames)
        On Error Resume Next
        ColNum = WorksheetFunction.Match(FieldNames(cntFields), MyRng.Rows(1), 0)
        Set MyRngC = MyRng2.Columns(ColNum).Cells
        MyRngC.Name = "p" & cntSheets & "." & FieldNames(cntFields)
        On Error GoTo 0
    Next cntFields

Next cntSheets

End Sub

If you wish to delete the names quickly (for example you want to change the field names) run this macro:

Code:
Sub DeleteFieldNames()
Dim ws As Worksheet
Dim MyRng As Range, MyRng2 As Range, MyRngC As Range, MyCell As Range
Dim SheetNames(), FieldNames(), cntSheets As Integer, cntFields As Integer
Dim ColNum As Integer
Dim strName As String

SheetNames = Application.Transpose([MySheets].Value)
FieldNames = Application.Transpose([MyFields].Value)

For cntSheets = LBound(SheetNames) To UBound(SheetNames)
   
    For cntFields = LBound(FieldNames) To UBound(FieldNames)
       On Error Resume Next
        strName = "p" & cntSheets & "." & FieldNames(cntFields)
        ActiveWorkbook.Names(strName).Delete
        On Error GoTo 0
    Next cntFields

Next cntSheets

End Sub

And here is the user defined function. This is really just a SUMIF formula that references the named ranges that we have created, but it loops through all the worksheets adding the values of all of the named ranges.

Code:
Function SumSales(DateCell As Range, TypeCell As Range) As Double

Dim DateRng As String
Dim TypeRng As String

Dim SheetsCount As Integer
Dim cnt As Integer
Dim tempSum As Double


SheetsCount = [MySheets].Cells.Count
tempSum = 0
For cnt = 1 To SheetsCount
    DateRng = "p" & cnt & "." & "Date"
    TypeRng = "p" & cnt & "." & TypeCell
    tempSum = WorksheetFunction.SumIf(Range(DateRng), DateCell.Value, Range(TypeRng))
Next cnt

SumSales = tempSum
End Function

Here is a sample of the output - first the totals (this can be on a hidden workheet)

[TABLE="width: 335"]
<tbody>[TR]
[TD]Aggregate[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]Sales[/TD]
[TD]Units[/TD]
[TD]Palettes[/TD]
[/TR]
[TR]
[TD]06/09/2013[/TD]
[TD]6[/TD]
[TD]5[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]12/09/2013[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]13/09/2013[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]19/09/2013[/TD]
[TD]4[/TD]
[TD]11[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]21/09/2013[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]24/09/2013[/TD]
[TD]24[/TD]
[TD]41[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]25/09/2013[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]26/09/2013[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]27/09/2013[/TD]
[TD]11[/TD]
[TD]4[/TD]
[TD]29[/TD]
[/TR]
[TR]
[TD]28/09/2013[/TD]
[TD]3[/TD]
[TD]6[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]29/09/2013[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]

In the above the formula looks like this: =SumSales($C8,D$7)
The C column contains the dates while the row 7 (starting at column D) contains the category names such as "Sales"

And he is the RANK output

[TABLE="width: 335"]
<tbody>[TR]
[TD]Aggregate[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]Sales[/TD]
[TD]Units[/TD]
[TD]Palettes[/TD]
[/TR]
[TR]
[TD="align: right"]06/09/2013[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]12/09/2013[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]13/09/2013[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]19/09/2013[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]21/09/2013[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]24/09/2013[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]25/09/2013[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]26/09/2013[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]27/09/2013[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]28/09/2013[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]29/09/2013[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]10[/TD]
[/TR]
</tbody>[/TABLE]

And this is what the formula looks like
=RANK('Summary Total'!D8,'Summary Total'!D$8:D$18,0)

Please note if and when you make changes to field names you must re-enter the formula (it is not just enough to press F9 to calculate).



I'll add one more thing. The macro creates static named ranges. When I first started attacked this problem I tried using some dynamic named ranges, which could be a worthwhile alternative:
For example:
p1.Date =OFFSET('Platform 1'!$A$1,0,MATCH("Date",'Platform 1'!$1:$1,0)-1,COUNTA('Platform 1'!$A:$A),1)

p1.Sales =OFFSET('Platform 1'!$A$1,0,MATCH("Sales",'Platform 1'!$1:$1,0)-1,COUNTA('Platform 1'!$A:$A),1)

BUT I think the static names are just as easy. If you add more data just delete the existing names and then recreate them using the macro I have provided.

If any MVP has comments or think this can be improved I would love to hear.

And of course if there is an Excel genious out there who know how to solve the OPs problem with a single formula tell us all about it. I would amazed if anybody could solve with a single formula.
 
Last edited:
Upvote 0
Ooops sorry in one of my edits of the UDF I made a small mistake - it is only taking the values from the last worksheet in the loop. Here is the correction.

Code:
Function SumSales(DateCell As Range, TypeCell As Range) As Double

Dim DateRng As String
Dim TypeRng As String

Dim SheetsCount As Integer
Dim cnt As Integer
Dim tempSum As Double


SheetsCount = [MySheets].Cells.Count
tempSum = 0
For cnt = 1 To SheetsCount
    DateRng = "p" & cnt & "." & "Date"
    TypeRng = "p" & cnt & "." & TypeCell
    tempSum = WorksheetFunction.SumIf(Range(DateRng), DateCell.Value, Range(TypeRng)) + tempSum
Next cnt

SumSales = tempSum
End Function

Use the following formula:

=SumSales($C8,D$7)

And here are the totals it returns (this is based on the original sample file posted by the OP)

[TABLE="width: 335"]
<tbody>[TR]
[TD]Aggregate[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]Sales[/TD]
[TD]Units[/TD]
[TD]Palettes[/TD]
[/TR]
[TR]
[TD]06/09/2013[/TD]
[TD]83[/TD]
[TD]124[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD]12/09/2013[/TD]
[TD]44[/TD]
[TD]80[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]13/09/2013[/TD]
[TD]13[/TD]
[TD]36[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]19/09/2013[/TD]
[TD]33[/TD]
[TD]112[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]21/09/2013[/TD]
[TD]30[/TD]
[TD]70[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]24/09/2013[/TD]
[TD]223[/TD]
[TD]625[/TD]
[TD]104[/TD]
[/TR]
[TR]
[TD]25/09/2013[/TD]
[TD]13[/TD]
[TD]29[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]26/09/2013[/TD]
[TD]82[/TD]
[TD]152[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]27/09/2013[/TD]
[TD]105[/TD]
[TD]202[/TD]
[TD]79[/TD]
[/TR]
[TR]
[TD]28/09/2013[/TD]
[TD]12[/TD]
[TD]19[/TD]
[TD]24[/TD]
[/TR]
[TR]
[TD]29/09/2013[/TD]
[TD]40[/TD]
[TD]107[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]


And rank

[TABLE="width: 335"]
<tbody>[TR]
[TD]Aggregate[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[TD]Rank[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]Sales[/TD]
[TD]Units[/TD]
[TD]Palettes[/TD]
[/TR]
[TR]
[TD="align: right"]06/09/2013[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]12/09/2013[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]13/09/2013[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="align: right"]19/09/2013[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]21/09/2013[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]24/09/2013[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]25/09/2013[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]26/09/2013[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: right"]27/09/2013[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]28/09/2013[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]29/09/2013[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]9[/TD]
[/TR]
</tbody>[/TABLE]

Edit: I see Marcello has beaten me to it :) Well now the OP has two solutions he can experiment with. Marcello's might be easier if the OP wants to avoid using VBA. It depends.
 
Last edited:
Upvote 0
Re-thinking

You can use a much more simpler formula to do comparisons against all sheets

Assuming you have already:
1. created the named range Sheets, as shown on my previous post
2. inserted the formulae in J8:K18

Try


[TABLE="class: grid"]
<TBODY>[TR]
[TD][/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[TD]
H
[/TD]
[TD]
I
[/TD]
[TD]
J
[/TD]
[TD]
K
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
Aggregate​
[/TD]
[TD]
Rank​
[/TD]
[TD]
Rank​
[/TD]
[TD]
Rank​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
Agg days​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]
Date​
[/TD]
[TD]
Sales​
[/TD]
[TD]
Units​
[/TD]
[TD]
Palettes​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8
[/TD]
[TD]
14/10/2013​
[/TD]
[TD]
627​
[/TD]
[TD]
594​
[/TD]
[TD]
688​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
7​
[/TD]
[TD]
13​
[/TD]
[TD]
14​
[/TD]
[/TR]
[TR]
[TD]
9
[/TD]
[TD]
15/10/2013​
[/TD]
[TD]
701​
[/TD]
[TD]
677​
[/TD]
[TD]
706​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
25​
[/TD]
[TD]
36​
[/TD]
[TD]
4​
[/TD]
[/TR]
[TR]
[TD]
10
[/TD]
[TD]
16/10/2013​
[/TD]
[TD]
641​
[/TD]
[TD]
605​
[/TD]
[TD]
679​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
10​
[/TD]
[TD]
0​
[/TD]
[/TR]
[TR]
[TD]
11
[/TD]
[TD]
17/10/2013​
[/TD]
[TD]
664​
[/TD]
[TD]
630​
[/TD]
[TD]
692​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
11​
[/TD]
[TD]
15​
[/TD]
[TD]
3​
[/TD]
[/TR]
[TR]
[TD]
12
[/TD]
[TD]
18/10/2013​
[/TD]
[TD]
424​
[/TD]
[TD]
353​
[/TD]
[TD]
679​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
2​
[/TD]
[TD]
10​
[/TD]
[TD]
1​
[/TD]
[/TR]
[TR]
[TD]
13
[/TD]
[TD]
19/10/2013​
[/TD]
[TD]
692​
[/TD]
[TD]
664​
[/TD]
[TD]
679​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
19​
[/TD]
[TD]
10​
[/TD]
[TD]
5​
[/TD]
[/TR]
[TR]
[TD]
14
[/TD]
[TD]
20/10/2013​
[/TD]
[TD]
689​
[/TD]
[TD]
657​
[/TD]
[TD]
697​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
16​
[/TD]
[TD]
17​
[/TD]
[TD]
9​
[/TD]
[/TR]
[TR]
[TD]
15
[/TD]
[TD]
21/10/2013​
[/TD]
[TD]
591​
[/TD]
[TD]
547​
[/TD]
[TD]
654​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
5​
[/TD]
[TD]
7​
[/TD]
[TD]
3​
[/TD]
[/TR]
[TR]
[TD]
16
[/TD]
[TD]
22/10/2013​
[/TD]
[TD]
591​
[/TD]
[TD]
547​
[/TD]
[TD]
654​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
5​
[/TD]
[TD]
7​
[/TD]
[TD]
5​
[/TD]
[/TR]
[TR]
[TD]
17
[/TD]
[TD]
23/10/2013​
[/TD]
[TD]
613​
[/TD]
[TD]
570​
[/TD]
[TD]
690​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
6​
[/TD]
[TD]
14​
[/TD]
[TD]
1​
[/TD]
[/TR]
[TR]
[TD]
18
[/TD]
[TD]
24/10/2013​
[/TD]
[TD]
670​
[/TD]
[TD]
638​
[/TD]
[TD]
679​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
12​
[/TD]
[TD]
10​
[/TD]
[TD]
7​
[/TD]
[/TR]
</TBODY>[/TABLE]


Formula in D8 copied down
=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!B:B"),"<"&I8))

Formula in E8 copied down
=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!C:C"),"<"&J8))

Formula in F8 copied down
=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!D:D"),"<"&K8))

If you do not want helper cells (I8:K18) you can substitute, in the formulae above, I8, J8 and K8 by the formulae in these cells.

For example

Formula in D8 copied down
=SUMPRODUCT(COUNTIF(INDIRECT("'"&Sheets&"'!B:B"),"<"&SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!B:B")))))

M.
 
Upvote 0
Edit: I see Marcello has beaten me to it :) Well now the OP has two solutions he can experiment with. Marcello's might be easier if the OP wants to avoid using VBA. It depends.

Do you think so? I'm not so sure. Still confused...:confused:

Let's wait the OP.

M.
 
Upvote 0
Do you think so? I'm not so sure. Still confused...:confused:

Let's wait the OP.

M.

Hi Marcello

Check out my VBA solution using the OPs second workbook. I think it returns the correct results. It only takes a couple of minutes to set up as well and does not require such incredibly complex formulas.

https://www.dropbox.com/s/3e5uui5ozibu5w8/Excel Question-version 2.xlsm

* my create names macro posted earlied includes a MsgBox line I put in for testing. This can be removed (as it has been in this workbook).
 
Last edited:
Upvote 0
Harry,

I think you are right. What the OP needs is (using new file)


[Table="class: grid"][tr][td] [/td][td]
C
[/td][td]
D
[/td][td]
E
[/td][td]
F
[/td][td]
G
[/td][td]
H
[/td][td]
I
[/td][td]
J
[/td][td]
K
[/td][/tr]
[tr][td]
6
[/td][td]
Aggregate​
[/td][td]
Rank​
[/td][td]
Rank​
[/td][td]
Rank​
[/td][td] [/td][td] [/td][td]
Agg days​
[/td][td] [/td][td] [/td][/tr]
[tr][td]
7
[/td][td]
Date​
[/td][td]
Sales​
[/td][td]
Units​
[/td][td]
Palettes​
[/td][td] [/td][td] [/td][td] [/td][td] [/td][td] [/td][/tr]
[tr][td]
8
[/td][td]
14/10/2013​
[/td][td]
7​
[/td][td]
5​
[/td][td]
1​
[/td][td] [/td][td] [/td][td]
7​
[/td][td]
13​
[/td][td]
14​
[/td][/tr]
[tr][td]
9
[/td][td]
15/10/2013​
[/td][td]
1​
[/td][td]
1​
[/td][td]
6​
[/td][td] [/td][td] [/td][td]
25​
[/td][td]
36​
[/td][td]
4​
[/td][/tr]
[tr][td]
10
[/td][td]
16/10/2013​
[/td][td]
6​
[/td][td]
6​
[/td][td]
11​
[/td][td] [/td][td] [/td][td]
8​
[/td][td]
10​
[/td][td]
0​
[/td][/tr]
[tr][td]
11
[/td][td]
17/10/2013​
[/td][td]
5​
[/td][td]
3​
[/td][td]
7​
[/td][td] [/td][td] [/td][td]
11​
[/td][td]
15​
[/td][td]
3​
[/td][/tr]
[tr][td]
12
[/td][td]
18/10/2013​
[/td][td]
11​
[/td][td]
6​
[/td][td]
9​
[/td][td] [/td][td] [/td][td]
2​
[/td][td]
10​
[/td][td]
1​
[/td][/tr]
[tr][td]
13
[/td][td]
19/10/2013​
[/td][td]
2​
[/td][td]
6​
[/td][td]
4​
[/td][td] [/td][td] [/td][td]
19​
[/td][td]
10​
[/td][td]
5​
[/td][/tr]
[tr][td]
14
[/td][td]
20/10/2013​
[/td][td]
3​
[/td][td]
2​
[/td][td]
2​
[/td][td] [/td][td] [/td][td]
16​
[/td][td]
17​
[/td][td]
9​
[/td][/tr]
[tr][td]
15
[/td][td]
21/10/2013​
[/td][td]
9​
[/td][td]
10​
[/td][td]
7​
[/td][td] [/td][td] [/td][td]
5​
[/td][td]
7​
[/td][td]
3​
[/td][/tr]
[tr][td]
16
[/td][td]
22/10/2013​
[/td][td]
9​
[/td][td]
10​
[/td][td]
4​
[/td][td] [/td][td] [/td][td]
5​
[/td][td]
7​
[/td][td]
5​
[/td][/tr]
[tr][td]
17
[/td][td]
23/10/2013​
[/td][td]
8​
[/td][td]
4​
[/td][td]
9​
[/td][td] [/td][td] [/td][td]
6​
[/td][td]
14​
[/td][td]
1​
[/td][/tr]
[tr][td]
18
[/td][td]
24/10/2013​
[/td][td]
4​
[/td][td]
6​
[/td][td]
3​
[/td][td] [/td][td] [/td][td]
12​
[/td][td]
10​
[/td][td]
7​
[/td][/tr]
[/table]


Formula in I8 copied down
=SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!B:B")))

Formula in J8 copied down
=SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!C:C")))

Formula in K8 copied down
=SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!A:A"),$C8,INDIRECT("'"&Sheets&"'!D:D")))

Formula in D8 copied across and down
=RANK(I8,I$8:I$18)

M.
 
Upvote 0
Hi Marcello

Check out my VBA solution using the OPs second workbook. I think it returns the correct results. It only takes a couple of minutes to set up as well and does not require such incredibly complex formulas.

https://www.dropbox.com/s/3e5uui5ozibu5w8/Excel Question-version 2.xlsm

* my create names macro posted earlied includes a MsgBox line I put in for testing. This can be removed (as it has been in this workbook).

I had already downloaded your file and used my formulas x your macro. The results matches perfectly (see below)

BTW, my formulae for the helper columns (I, J and K) are not so complex - see my previous posts.

Checking


[TABLE="class: grid"]
<TBODY>[TR]
[TD][/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[TD]
H
[/TD]
[TD]
I
[/TD]
[TD]
J
[/TD]
[TD]
K
[/TD]
[TD]
L
[/TD]
[TD]
M
[/TD]
[TD]
N
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
Aggregate​
[/TD]
[TD]
Sum​
[/TD]
[TD]
Sum​
[/TD]
[TD]
Sum​
[/TD]
[TD][/TD]
[TD]
Rank​
[/TD]
[TD]
Rank​
[/TD]
[TD]
Rank​
[/TD]
[TD][/TD]
[TD]
My Formulas​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]
Aggregate​
[/TD]
[TD]
Sales​
[/TD]
[TD]
Units​
[/TD]
[TD]
Palettes​
[/TD]
[TD][/TD]
[TD]
Sales​
[/TD]
[TD]
Units​
[/TD]
[TD]
Palettes​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8
[/TD]
[TD]
06/09/2013​
[/TD]
[TD]
83​
[/TD]
[TD]
124​
[/TD]
[TD]
33​
[/TD]
[TD][/TD]
[TD]
7​
[/TD]
[TD]
8​
[/TD]
[TD]
9​
[/TD]
[TD][/TD]
[TD]
83​
[/TD]
[TD]
124​
[/TD]
[TD]
33​
[/TD]
[/TR]
[TR]
[TD]
9
[/TD]
[TD]
12/09/2013​
[/TD]
[TD]
44​
[/TD]
[TD]
80​
[/TD]
[TD]
17​
[/TD]
[TD][/TD]
[TD]
11​
[/TD]
[TD]
13​
[/TD]
[TD]
20​
[/TD]
[TD][/TD]
[TD]
44​
[/TD]
[TD]
80​
[/TD]
[TD]
17​
[/TD]
[/TR]
[TR]
[TD]
10
[/TD]
[TD]
13/09/2013​
[/TD]
[TD]
13​
[/TD]
[TD]
36​
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD]
26​
[/TD]
[TD]
21​
[/TD]
[TD]
33​
[/TD]
[TD][/TD]
[TD]
13​
[/TD]
[TD]
36​
[/TD]
[TD]
2​
[/TD]
[/TR]
[TR]
[TD]
11
[/TD]
[TD]
19/09/2013​
[/TD]
[TD]
33​
[/TD]
[TD]
112​
[/TD]
[TD]
30​
[/TD]
[TD][/TD]
[TD]
14​
[/TD]
[TD]
9​
[/TD]
[TD]
11​
[/TD]
[TD][/TD]
[TD]
33​
[/TD]
[TD]
112​
[/TD]
[TD]
30​
[/TD]
[/TR]
[TR]
[TD]
12
[/TD]
[TD]
21/09/2013​
[/TD]
[TD]
30​
[/TD]
[TD]
70​
[/TD]
[TD]
18​
[/TD]
[TD][/TD]
[TD]
17​
[/TD]
[TD]
14​
[/TD]
[TD]
17​
[/TD]
[TD][/TD]
[TD]
30​
[/TD]
[TD]
70​
[/TD]
[TD]
18​
[/TD]
[/TR]
[TR]
[TD]
13
[/TD]
[TD]
24/09/2013​
[/TD]
[TD]
223​
[/TD]
[TD]
625​
[/TD]
[TD]
104​
[/TD]
[TD][/TD]
[TD]
3​
[/TD]
[TD]
2​
[/TD]
[TD]
5​
[/TD]
[TD][/TD]
[TD]
223​
[/TD]
[TD]
625​
[/TD]
[TD]
104​
[/TD]
[/TR]
[TR]
[TD]
14
[/TD]
[TD]
25/09/2013​
[/TD]
[TD]
13​
[/TD]
[TD]
29​
[/TD]
[TD]
11​
[/TD]
[TD][/TD]
[TD]
26​
[/TD]
[TD]
24​
[/TD]
[TD]
24​
[/TD]
[TD][/TD]
[TD]
13​
[/TD]
[TD]
29​
[/TD]
[TD]
11​
[/TD]
[/TR]
[TR]
[TD]
15
[/TD]
[TD]
26/09/2013​
[/TD]
[TD]
82​
[/TD]
[TD]
152​
[/TD]
[TD]
32​
[/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
7​
[/TD]
[TD]
10​
[/TD]
[TD][/TD]
[TD]
82​
[/TD]
[TD]
152​
[/TD]
[TD]
32​
[/TD]
[/TR]
[TR]
[TD]
16
[/TD]
[TD]
27/09/2013​
[/TD]
[TD]
105​
[/TD]
[TD]
202​
[/TD]
[TD]
79​
[/TD]
[TD][/TD]
[TD]
6​
[/TD]
[TD]
6​
[/TD]
[TD]
7​
[/TD]
[TD][/TD]
[TD]
105​
[/TD]
[TD]
202​
[/TD]
[TD]
79​
[/TD]
[/TR]
[TR]
[TD]
17
[/TD]
[TD]
28/09/2013​
[/TD]
[TD]
12​
[/TD]
[TD]
19​
[/TD]
[TD]
24​
[/TD]
[TD][/TD]
[TD]
28​
[/TD]
[TD]
28​
[/TD]
[TD]
14​
[/TD]
[TD][/TD]
[TD]
12​
[/TD]
[TD]
19​
[/TD]
[TD]
24​
[/TD]
[/TR]
[TR]
[TD]
18
[/TD]
[TD]
29/09/2013​
[/TD]
[TD]
40​
[/TD]
[TD]
107​
[/TD]
[TD]
12​
[/TD]
[TD][/TD]
[TD]
12​
[/TD]
[TD]
10​
[/TD]
[TD]
22​
[/TD]
[TD][/TD]
[TD]
40​
[/TD]
[TD]
107​
[/TD]
[TD]
12​
[/TD]
[/TR]
[TR]
[TD]
19
[/TD]
[TD]
30/09/2013​
[/TD]
[TD]
31​
[/TD]
[TD]
90​
[/TD]
[TD]
126​
[/TD]
[TD][/TD]
[TD]
15​
[/TD]
[TD]
11​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD]
31​
[/TD]
[TD]
90​
[/TD]
[TD]
126​
[/TD]
[/TR]
[TR]
[TD]
20
[/TD]
[TD]
01/10/2013​
[/TD]
[TD]
403​
[/TD]
[TD]
884​
[/TD]
[TD]
516​
[/TD]
[TD][/TD]
[TD]
1​
[/TD]
[TD]
1​
[/TD]
[TD]
1​
[/TD]
[TD][/TD]
[TD]
403​
[/TD]
[TD]
884​
[/TD]
[TD]
516​
[/TD]
[/TR]
[TR]
[TD]
21
[/TD]
[TD]
02/10/2013​
[/TD]
[TD]
30​
[/TD]
[TD]
55​
[/TD]
[TD]
18​
[/TD]
[TD][/TD]
[TD]
17​
[/TD]
[TD]
15​
[/TD]
[TD]
17​
[/TD]
[TD][/TD]
[TD]
30​
[/TD]
[TD]
55​
[/TD]
[TD]
18​
[/TD]
[/TR]
[TR]
[TD]
22
[/TD]
[TD]
03/10/2013​
[/TD]
[TD]
47​
[/TD]
[TD]
49​
[/TD]
[TD]
35​
[/TD]
[TD][/TD]
[TD]
9​
[/TD]
[TD]
16​
[/TD]
[TD]
8​
[/TD]
[TD][/TD]
[TD]
47​
[/TD]
[TD]
49​
[/TD]
[TD]
35​
[/TD]
[/TR]
[TR]
[TD]
23
[/TD]
[TD]
04/10/2013​
[/TD]
[TD]
21​
[/TD]
[TD]
27​
[/TD]
[TD]
19​
[/TD]
[TD][/TD]
[TD]
20​
[/TD]
[TD]
27​
[/TD]
[TD]
16​
[/TD]
[TD][/TD]
[TD]
21​
[/TD]
[TD]
27​
[/TD]
[TD]
19​
[/TD]
[/TR]
[TR]
[TD]
24
[/TD]
[TD]
05/10/2013​
[/TD]
[TD]
31​
[/TD]
[TD]
44​
[/TD]
[TD]
23​
[/TD]
[TD][/TD]
[TD]
15​
[/TD]
[TD]
17​
[/TD]
[TD]
15​
[/TD]
[TD][/TD]
[TD]
31​
[/TD]
[TD]
44​
[/TD]
[TD]
23​
[/TD]
[/TR]
[TR]
[TD]
25
[/TD]
[TD]
07/10/2013​
[/TD]
[TD]
35​
[/TD]
[TD]
85​
[/TD]
[TD]
26​
[/TD]
[TD][/TD]
[TD]
13​
[/TD]
[TD]
12​
[/TD]
[TD]
13​
[/TD]
[TD][/TD]
[TD]
35​
[/TD]
[TD]
85​
[/TD]
[TD]
26​
[/TD]
[/TR]
[TR]
[TD]
26
[/TD]
[TD]
08/10/2013​
[/TD]
[TD]
179​
[/TD]
[TD]
281​
[/TD]
[TD]
180​
[/TD]
[TD][/TD]
[TD]
4​
[/TD]
[TD]
4​
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD]
179​
[/TD]
[TD]
281​
[/TD]
[TD]
180​
[/TD]
[/TR]
[TR]
[TD]
27
[/TD]
[TD]
09/10/2013​
[/TD]
[TD]
15​
[/TD]
[TD]
37​
[/TD]
[TD]
27​
[/TD]
[TD][/TD]
[TD]
22​
[/TD]
[TD]
19​
[/TD]
[TD]
12​
[/TD]
[TD][/TD]
[TD]
15​
[/TD]
[TD]
37​
[/TD]
[TD]
27​
[/TD]
[/TR]
[TR]
[TD]
28
[/TD]
[TD]
10/10/2013​
[/TD]
[TD]
45​
[/TD]
[TD]
42​
[/TD]
[TD]
11​
[/TD]
[TD][/TD]
[TD]
10​
[/TD]
[TD]
18​
[/TD]
[TD]
24​
[/TD]
[TD][/TD]
[TD]
45​
[/TD]
[TD]
42​
[/TD]
[TD]
11​
[/TD]
[/TR]
[TR]
[TD]
29
[/TD]
[TD]
11/10/2013​
[/TD]
[TD]
8​
[/TD]
[TD]
14​
[/TD]
[TD]
15​
[/TD]
[TD][/TD]
[TD]
31​
[/TD]
[TD]
29​
[/TD]
[TD]
21​
[/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
14​
[/TD]
[TD]
15​
[/TD]
[/TR]
[TR]
[TD]
30
[/TD]
[TD]
12/10/2013​
[/TD]
[TD]
14​
[/TD]
[TD]
33​
[/TD]
[TD]
11​
[/TD]
[TD][/TD]
[TD]
24​
[/TD]
[TD]
23​
[/TD]
[TD]
24​
[/TD]
[TD][/TD]
[TD]
14​
[/TD]
[TD]
33​
[/TD]
[TD]
11​
[/TD]
[/TR]
[TR]
[TD]
31
[/TD]
[TD]
13/10/2013​
[/TD]
[TD]
7​
[/TD]
[TD]
9​
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD]
33​
[/TD]
[TD]
35​
[/TD]
[TD]
33​
[/TD]
[TD][/TD]
[TD]
7​
[/TD]
[TD]
9​
[/TD]
[TD]
2​
[/TD]
[/TR]
[TR]
[TD]
32
[/TD]
[TD]
14/10/2013​
[/TD]
[TD]
15​
[/TD]
[TD]
34​
[/TD]
[TD]
11​
[/TD]
[TD][/TD]
[TD]
22​
[/TD]
[TD]
22​
[/TD]
[TD]
24​
[/TD]
[TD][/TD]
[TD]
15​
[/TD]
[TD]
34​
[/TD]
[TD]
11​
[/TD]
[/TR]
[TR]
[TD]
33
[/TD]
[TD]
15/10/2013​
[/TD]
[TD]
230​
[/TD]
[TD]
287​
[/TD]
[TD]
107​
[/TD]
[TD][/TD]
[TD]
2​
[/TD]
[TD]
3​
[/TD]
[TD]
4​
[/TD]
[TD][/TD]
[TD]
230​
[/TD]
[TD]
287​
[/TD]
[TD]
107​
[/TD]
[/TR]
[TR]
[TD]
34
[/TD]
[TD]
16/10/2013​
[/TD]
[TD]
8​
[/TD]
[TD]
14​
[/TD]
[TD]
5​
[/TD]
[TD][/TD]
[TD]
31​
[/TD]
[TD]
29​
[/TD]
[TD]
30​
[/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
14​
[/TD]
[TD]
5​
[/TD]
[/TR]
[TR]
[TD]
35
[/TD]
[TD]
17/10/2013​
[/TD]
[TD]
26​
[/TD]
[TD]
37​
[/TD]
[TD]
11​
[/TD]
[TD][/TD]
[TD]
19​
[/TD]
[TD]
19​
[/TD]
[TD]
24​
[/TD]
[TD][/TD]
[TD]
26​
[/TD]
[TD]
37​
[/TD]
[TD]
11​
[/TD]
[/TR]
[TR]
[TD]
36
[/TD]
[TD]
18/10/2013​
[/TD]
[TD]
20​
[/TD]
[TD]
28​
[/TD]
[TD]
18​
[/TD]
[TD][/TD]
[TD]
21​
[/TD]
[TD]
26​
[/TD]
[TD]
17​
[/TD]
[TD][/TD]
[TD]
20​
[/TD]
[TD]
28​
[/TD]
[TD]
18​
[/TD]
[/TR]
[TR]
[TD]
37
[/TD]
[TD]
19/10/2013​
[/TD]
[TD]
7​
[/TD]
[TD]
14​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[TD]
33​
[/TD]
[TD]
29​
[/TD]
[TD]
32​
[/TD]
[TD][/TD]
[TD]
7​
[/TD]
[TD]
14​
[/TD]
[TD]
3​
[/TD]
[/TR]
[TR]
[TD]
38
[/TD]
[TD]
20/10/2013​
[/TD]
[TD]
9​
[/TD]
[TD]
11​
[/TD]
[TD]
5​
[/TD]
[TD][/TD]
[TD]
30​
[/TD]
[TD]
33​
[/TD]
[TD]
30​
[/TD]
[TD][/TD]
[TD]
9​
[/TD]
[TD]
11​
[/TD]
[TD]
5​
[/TD]
[/TR]
[TR]
[TD]
39
[/TD]
[TD]
21/10/2013​
[/TD]
[TD]
14​
[/TD]
[TD]
29​
[/TD]
[TD]
12​
[/TD]
[TD][/TD]
[TD]
24​
[/TD]
[TD]
24​
[/TD]
[TD]
22​
[/TD]
[TD][/TD]
[TD]
14​
[/TD]
[TD]
29​
[/TD]
[TD]
12​
[/TD]
[/TR]
[TR]
[TD]
40
[/TD]
[TD]
22/10/2013​
[/TD]
[TD]
170​
[/TD]
[TD]
229​
[/TD]
[TD]
90​
[/TD]
[TD][/TD]
[TD]
5​
[/TD]
[TD]
5​
[/TD]
[TD]
6​
[/TD]
[TD][/TD]
[TD]
170​
[/TD]
[TD]
229​
[/TD]
[TD]
90​
[/TD]
[/TR]
[TR]
[TD]
41
[/TD]
[TD]
23/10/2013​
[/TD]
[TD]
6​
[/TD]
[TD]
14​
[/TD]
[TD]
1​
[/TD]
[TD][/TD]
[TD]
35​
[/TD]
[TD]
29​
[/TD]
[TD]
35​
[/TD]
[TD][/TD]
[TD]
6​
[/TD]
[TD]
14​
[/TD]
[TD]
1​
[/TD]
[/TR]
[TR]
[TD]
42
[/TD]
[TD]
24/10/2013​
[/TD]
[TD]
12​
[/TD]
[TD]
10​
[/TD]
[TD]
7​
[/TD]
[TD][/TD]
[TD]
28​
[/TD]
[TD]
34​
[/TD]
[TD]
29​
[/TD]
[TD][/TD]
[TD]
12​
[/TD]
[TD]
10​
[/TD]
[TD]
7​
[/TD]
[/TR]
</TBODY>[/TABLE]


M.
 
Upvote 0
Marcelo that formula is great. I like the use of the named range that stores the sheets name. So the OP can easily add more sheets. I think that trumps my UDF for sure. And yes not so complex after all. Neat :)
I'll definitely study that solution and see if I can apply to my own purposes. Cheers.

edit: I started off trying to do a formula with INDIRECT too, but I made the mistake of creating dynamic named ranges - which as I always forget don't seem to work with INDIRECT (which is a shame).
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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