1) a slight tweak to the current function:
Public Function COUNTIF3D(Rng As Range, v As Variant, SheetNames As Range)
'JBeaucaire (10/12/2009)
Application.Volatile
Dim cell As Range
For Each cell In SheetNames
If Evaluate("ISREF('" & cell & "'!A1)") Then _
COUNTIF3D = WorksheetFunction.CountIf(Sheets(cell).Range(Rng.Address), v) + COUNTIF3D
Next cell
End Function
2) Although I like trying to write applicable new functions, I really think the solution lies in using a more standard sheet design. Having 31 separate days of data that you want to analyze as a single data set is obviously cumbersome.
I would suggest you use a single data sheet for this. Add a new column A called "day" or "date" and put the 1-31 in there as you go down the sheet all through the month
Then your summary page can use simple sumif/countif and eliminate all of this. You can have an autofilter active on the data sheet so with the click of dropdown you can instantly be viewing only a certain, too, just like you would with separate sheets but without needing to have separate sheets.
In this sample sheet I've activated Excel's "List" feature on the dataset in the new sheet called "Data". The List feature bounds the dataset as group and offers an expansion row at the bottom. If you select a new day in that expansion row, Excel will instantly expand the dataset to permently include the new row and copy all the formulas and formatting to the new row without you having to do any of that. Very slick.
Use the dropbox in column A to filter the data anytime you want to see a smaller subset.
All the formulas on your Monthly Report sheet are simplified to match. Each colored section is a different formula.
I would find THIS data simpler to maintain by a longshot.
Bookmarks