Hey everyone,
I hope someone is able to help me edit this array formula, I've attempted multiple times to add it myself but it seems to not like me very much....
Here is the formula:
The VBA code is as follows:
This code seems to work fine (the red is what I've changed from the source line given to me) when it comes to finding the total number of unique values along these three tabs in Column B. I would like to edit this code to add an IF/COUNTIF statement (whichever would work). I just want it to read the Value of A2 in the sheet where I enter the formula and find the unique number of values in Column B across all of the tabs for THAT value (which will be located in Column C of each tab) I hope this was clear and if not, I'm more than happy to clear it up more.
I hope someone is able to help me edit this array formula, I've attempted multiple times to add it myself but it seems to not like me very much....
Here is the formula:
Code:
=SUM(IF(FREQUENCY(IF(V(arrayunion([COLOR=#ff0000]TABONE!B2:B10000,TABTWO!B2:B10000,TABTHREE!B2:B10000[/COLOR]))<>"",MATCH(V(),V(),0)),ROW(INDIRECT("1:"&COLUMNS(V())))),1))
The VBA code is as follows:
Code:
Function ArrayUnion(ParamArray Arg() As Variant) As Variant
' Code: Juan Pablo González
' Spec: Aladin Akyurek
' May 4, 2003
' Ref: [URL="http://makeashorterlink.com/?P20022174"]TinyURL.com - shorten that long URL into a tiny URL[/URL]
Dim TempUnion() As Variant
Dim i As Long, Itm As Variant, Ctr As Long
For i = LBound(Arg) To UBound(Arg)
Arg(i) = Arg(i)
If IsArray(Arg(i)) Then
For Each Itm In Arg(i)
Ctr = Ctr + 1
ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Itm
Next Itm
Else
Ctr = Ctr + 1
ReDim Preserve TempUnion(1 To Ctr) As Variant
TempUnion(Ctr) = Arg(i)
End If
Next i
ArrayUnion = TempUnion
End Function
Public Function V(Optional vrnt As Variant) As Variant
'
' Stephen [COLOR=#417394]Dunn
[/COLOR]' 2002-09-12
'
Static vrntV As Variant
If Not IsMissing(vrnt) Then vrntV = vrnt
V = vrntV
End Function
This code seems to work fine (the red is what I've changed from the source line given to me) when it comes to finding the total number of unique values along these three tabs in Column B. I would like to edit this code to add an IF/COUNTIF statement (whichever would work). I just want it to read the Value of A2 in the sheet where I enter the formula and find the unique number of values in Column B across all of the tabs for THAT value (which will be located in Column C of each tab) I hope this was clear and if not, I'm more than happy to clear it up more.
Last edited: