+ Reply to Thread
Results 1 to 4 of 4

Count alarms from last 7 days (last 7 columns of data - some blank cells)

  1. #1
    Registered User
    Join Date
    11-08-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    12

    Count alarms from last 7 days (last 7 columns of data - some blank cells)

    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!

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,926

    Re: Count alarms from last 7 days (last 7 columns of data - some blank cells)

    . .

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,926

    Re: Count alarms from last 7 days (last 7 columns of data - some blank cells)

    Try this ...

    Last 7 days:

    =COUNTIFS(C3:MZ3,"*",C$1:MZ$1,">"&TODAY()-7)

  4. #4
    Registered User
    Join Date
    11-08-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    12

    Re: Count alarms from last 7 days (last 7 columns of data - some blank cells)

    Perfect!!

    Thanks Phoucam! Worked great. I was soo close

    For anyone else trying to accomplish this. The only thing I had to modify was -7 to -6 for the 7 day count. I guess it counted the Today() as well:
    [B}=COUNTIFS(C3:MZ3,"*",C$1:MZ$1,">"&TODAY()-6)[/B]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Count rows in all non blank cells in certain columns
    By Sekars in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2016, 03:22 AM
  2. Count blank cells in a range and contiguous blank cells also as single cells! Tricky One!
    By SebastianColombia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2015, 02:32 PM
  3. How to count blank cells in data range
    By puttu in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-11-2013, 01:48 PM
  4. Replies: 2
    Last Post: 07-25-2013, 01:01 PM
  5. Need to count Blank cells instead of data cells in Pivot table
    By plb999 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-19-2012, 09:01 PM
  6. [SOLVED] VBA to count cells with data between blank rows
    By Philcater in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2012, 04:40 PM
  7. Counting data in non blank cells and exclude certain data from the count
    By JohnG73 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-04-2007, 04:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1