• 409K Members
• 11.8K Online
• 466K Conversations

Highlighted
Visitor

# Rolling Calendar COUNTIFS question

I have a table that lists dates across the top row and a column listing items on the side. Image below.

This is meant to be a rolling calendar, with new dates being added all the time. I'm trying to come up with a formula that counts all the "a"s over the last two weeks by item (not counting the "a"s from weeks before that). If an item appears twice in the first column (eg. "lime" in the image above), the formula should add up all the "a"s in both rows where that item appears.

I've tried various combinations of COUNTIFS with ISOWEEKNUM but no luck so far.

Is something like this possible?

Appreciate any help!

Josh

# Re: Rolling Calendar COUNTIFS question

Given that Sheet1!A1 is blank, you may try this formula:
=SUMPRODUCT(--(INDEX(ItemData,1,
MATCH(INDEX(DateLabels,COUNT(DateLabels))-13,DateLabels,1)):
INDEX(ItemData,COUNTA(ItemLabels),COUNT(DateLabels))="a"))
The defined names are:
DateLabels=Sheet1!\$B\$1:INDEX(Sheet1!\$1:\$1,COUNT(Sheet1!\$1:\$1)+1)
ItemData=Sheet1!\$B\$2:INDEX(Sheet1!\$B:\$XFD,COUNTA(Sheet1!\$A:\$A)+1,COUNT(Sheet1!\$1:\$1)+1)
ItemLabels=Sheet1!\$A\$2:INDEX(Sheet1!\$A:\$A,COUNTA(Sheet1!\$A:\$A)+1)
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
21 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies