Afternoon All
I've cobbled together the following formula to give a Subtotal with multiple options when a column is filtered but it seems to be counting some things twice.
I'm sure there is a far more elegant formula I could use but the one I am using is below.
=((SUMPRODUCT(SUBTOTAL(3,OFFSET(J$41:J$1000,ROW(J$41:J$1000)-MIN(ROW(J$41:J$1000)),,1)),ISNUMBER(SEARCH("AL",J$41:J$1000))+0))+(SUMPRODUCT(SUBTOTAL(3,OFFSET(J$41:J$1000,ROW(J$41:J$1000)-MIN(ROW(J$41:J$1000)),,1)),ISNUMBER(SEARCH("AL pm",J$41:J$1000))+0))+(SUMPRODUCT(SUBTOTAL(3,OFFSET(J$41:J$1000,ROW(J$41:J$1000)-MIN(ROW(J$41:J$1000)),,1)),ISNUMBER(SEARCH("AL am",J$41:J$1000))+0)))
I thought it was working fine as it seems to be counting all the items with AL only fine but if any cells with AL am or AL pm in it is counting them twice. I'm assuming its because of the AL in all three options as if I change one of them to something unique it doesn't do it. Unfortunately that's not possible for this sheet.
Any thoughts and help would be most appreciated as I don't really understand what the formula is doing to know where to correct it.
I've cobbled together the following formula to give a Subtotal with multiple options when a column is filtered but it seems to be counting some things twice.
I'm sure there is a far more elegant formula I could use but the one I am using is below.
=((SUMPRODUCT(SUBTOTAL(3,OFFSET(J$41:J$1000,ROW(J$41:J$1000)-MIN(ROW(J$41:J$1000)),,1)),ISNUMBER(SEARCH("AL",J$41:J$1000))+0))+(SUMPRODUCT(SUBTOTAL(3,OFFSET(J$41:J$1000,ROW(J$41:J$1000)-MIN(ROW(J$41:J$1000)),,1)),ISNUMBER(SEARCH("AL pm",J$41:J$1000))+0))+(SUMPRODUCT(SUBTOTAL(3,OFFSET(J$41:J$1000,ROW(J$41:J$1000)-MIN(ROW(J$41:J$1000)),,1)),ISNUMBER(SEARCH("AL am",J$41:J$1000))+0)))
I thought it was working fine as it seems to be counting all the items with AL only fine but if any cells with AL am or AL pm in it is counting them twice. I'm assuming its because of the AL in all three options as if I change one of them to something unique it doesn't do it. Unfortunately that's not possible for this sheet.
Any thoughts and help would be most appreciated as I don't really understand what the formula is doing to know where to correct it.