Unfortunately I see now that countif() doesn't work with a 3d reference. I
see some other answers here have used a =sumproduct(n(... function to get
round this, but didn't understand it.
Can anyone here help?
Threed is part of an addon that turns a 3D reference into a 2D one, but in
the same addon there is countif.3D.
That addon is morefunc and can be downloaded (free) at:
http://xcell05.free.fr/morefunc/english/
"Mrfish" <Mrf...@discussions.microsoft.com> wrote in message
news:03281BBF-E4FA-4F66...@microsoft.com...
=SUMPRODUCT(COUNTIF(INDIRECT("'"&$A$2:$A$10&"'!D43"),"D"))
...where A2:A10 contains the sheet names. Alternatively, if you
download and install the free add-in, Morefunc, you can use COUNTIF.3D.
The add-in can be download at...
http://xcell05.free.fr/morefunc/english/
Hope this helps!
In article <03281BBF-E4FA-4F66...@microsoft.com>,
Function tryme()
For Each wks In Worksheets
If wks.Range("D3") = "D" Then
mycount = mycount + 1
End If
Next
tryme = mycount
End Function
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email
"Mrfish" <Mrf...@discussions.microsoft.com> wrote in message
news:03281BBF-E4FA-4F66...@microsoft.com...
However I don't really understand how it works, can you explain?
Second small issue - I want to copy the formula out across rows and columns,
and currently the D3 part is fixed. Is there an easy change to unfix the
reference?
Many thanks!
I typed a D into cell C16 and modified my formula to read
=SUMPRODUCT(COUNTIF(INDIRECT("'"&A2:A4&"'!D3"),C16))
and it returned the correct value
This change lets me copy the formula to other cells
=SUMPRODUCT(COUNTIF(INDIRECT("'"&$A$2:$A$4&"'!D3"),C18))
I typed a D3 into cell B16 and modified my formula to read
=SUMPRODUCT(COUNTIF(INDIRECT("'"&$A$2:$A$4&"'!"&B16),C16))
and it returned the correct value
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email
"Mrfish" <Mrf...@discussions.microsoft.com> wrote in message
news:AADC6D25-D86F-4F29...@microsoft.com...
> Second small issue - I want to copy the formula out across rows and columns,
> and currently the D3 part is fixed. Is there an easy change to unfix the
> reference?
Try...
=SUMPRODUCT(COUNTIF(INDIRECT("'"&$A$2:$A$10&"'!"&CELL("address",D3)),"D")
)
...where A2:A10 contains the sheet names.
Hope this helps!