Hello fellow excel activists!
I've got a problem to solve that I don't know how to word correctly and can't find the information I'm looking for in google or forum searches.
Every day I get a list of alarms which I'm trying to calculate a history of how often a piece of equipment has been in alarm over the last 7 days, 15 days, 30 days and 60 days.
A macro copies today's alarms to the last column so I know today's date is the last column, but I can't do an offset to find the end of row for each device since some devices don't have alarms in them on today's date and are blank. I guess I could force blank cells to have '0's in them, but that's if its really needed to make it work. Also I would rather not use the volatile Offset function since the database is pretty big already.
My data looks like this:
datasample.png
If someone could help me with the 7 day option I can figure the rest out pretty quick. Maybe there is a SUMPRODUCT or INDEX/MATCH way to cross check.
I need a formula for column A, that will find the last column used in row 1 (Today's date), then count back 7 days for each row and total the amount of alarms found.
If I use the following solution, with a new countifs for each day it works but it's very awkward and I'm sure there is a better way, especially when I would have to do the 30 or 60 day options.
=COUNTIFS(C3:MZ3,"*",C$1:MZ$1,TODAY())+COUNTIFS(C3:MZ3,"*",C$1:MZ$1,TODAY()-1)+COUNTIFS(C3:MZ3,"*",C$1:MZ$1,TODAY()-2) ETC...
Thanks for any help!
Bookmarks