Formula to figure out count based on category week i'm in and for previous week and current week to date


Active Member
Hi I have a

column A that has week ie 2019.26 represent 26 week of the calendar day.

Column B Date

Column D Reason Code WH BD HOS...

Assuming my week is Mon to Sat (no data on Sunday)

I would like to have a formula that would go to B2 that knows what today is and tells me how many "WH" are in column D:D based on the date i have in column B from last week.

in D2 it would do the same but week to date or current week so far

F2 - Previous month

H2 - Month to date

Thank you


Active Member
Maybe I can explain this better basically i'm looking for effectively is a vlookup for a code WH as an example but I want to be able to tell how many times the code came up last week. In another cell I want to be able to see how many times week to date that code came up. Basically both cells would auto update each time the spreadsheet is open.


Some videos you may like

This Week's Hot Topics

  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • find many based on a certain criteria
    good evening, I hope someone can help me? I have a workbook sheet 2 contains lots of data.... I would like to be able to find anything on sheet...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
  • Text Format
    I have a sheet for user to keyin the data. The format of the data can be 451 / 1903, 0012 / 9908 or 00287 / 0099. The number after the "/" is...
  • Syntax errors
    Good Morning, Trying to compile a workbook, I keep getting a few errors. Here are the first two: [code=rich]Syntax Error: Function...