COUNTIFS with cell reference

errollflynn

New Member
Joined
Jan 25, 2021
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I have a spreadsheet with employee data that contains a formula that identifies instances of consecutive weeks worked. There is an IF statement with a true value of "Yes" when consecutive weeks are identified. As each row identifies a work week, most employees have multiple rows of data and I am trying to count the number of consecutive weeks per employee. I tried using COUNTIFS while referencing the column containing the unique key in the first screenshot and the same value, but specifically the cell, in the second screenshot. It is not working as I'm getting 0's. Any help would be appreciated.

Thank you
 

Attachments

  • Capture1.JPG
    Capture1.JPG
    181.6 KB · Views: 16
  • Capture2.JPG
    Capture2.JPG
    18.2 KB · Views: 14

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Images are not very helpful in looking at possible solutions to your issue. Please use XL2BB to post a sample of your worksheet and expected results.
 
Upvote 0
Thank you for the feedback. Please see below.


Delete Data.xlsx
ABCDEFG
1KeyClient#Last_NameFull Namepay_period_startpay_period_endConsecutive
2.8482AEGP38.., DEX04/03/202204/16/2022Yes
3.8482AEGP38.., DEX04/10/202204/23/2022Yes
4.8482AEGP38.., DEX04/17/202204/30/2022Yes
5.8482AEGP38.., DEX04/24/202204/30/2022Yes
6ABC6188AEGP20ABCABC, JOHN01/02/202201/08/2022Yes
7ABC6188AEGP20ABCABC, JOHN01/09/202201/15/2022No
8ABC6188AEGP20ABCABC, JOHN01/23/202201/29/2022No
9ABC6188AEGP20ABCABC, JOHN02/13/202202/19/2022Yes
10ABC6188AEGP20ABCABC, JOHN02/20/202203/05/2022No
11ABC6188AEGP20ABCABC, JOHN02/20/202203/05/2022Yes
12ABC6188AEGP20ABCABC, JOHN02/27/202203/05/2022Yes
13ABC6188AEGP20ABCABC, JOHN03/06/202203/19/2022No
14ABC6188AEGP20ABCABC, JOHN03/20/202203/26/2022No
15ABC6188AEGP20ABCABC, JOHN03/20/202203/26/2022No
16ABC6188AEGP20ABCABC, JOHN04/10/202204/23/2022No
17ABC6188AEGP20ABCABC, JOHN04/10/202204/23/2022Yes
18ABC6188AEGP20ABCABC, JOHN04/17/202204/23/2022No
19ABC6188AEGP20ABCABC, JOHN04/17/202204/23/2022Yes
20ABC6188AEGP20ABCABC, JOHN04/24/202204/30/2022Yes
21ABC6188AEGP20ABCABC, JOHN05/01/202205/14/2022Yes
22ABC6188AEGP20ABCABC, JOHN05/08/202205/21/2022No
23ABC6188AEGP20ABCABC, JOHN05/08/202205/21/2022No
24ABC6188AEGP20ABCABC, JOHN05/08/202205/21/2022No
25ABC6188AEGP20ABCABC, JOHN05/29/202206/04/2022Yes
26ABC6188AEGP20ABCABC, JOHN06/05/202206/11/2022No
27ABC6188AEGP20ABCABC, JOHN06/19/202206/25/2022No
28ABC6188AEGP20ABCABC, JOHN07/10/202207/16/2022No
29ABC6188AEGP20ABCABC, JOHN07/10/202207/16/2022No
30ABC6188AEGP20ABCABC, JOHN08/21/202208/27/2022No
31ABC6188AEGP20ABCABC, JOHN09/04/202209/10/2022No
32ABC6188AEGP20ABCABC, JOHN09/18/202209/24/2022Yes
33ABC6188AEGP20ABCABC, JOHN09/25/202210/01/2022Yes
34ABC6188AEGP20ABCABC, JOHN10/02/202210/15/2022Yes
35ABC6188AEGP20ABCABC, JOHN10/09/202210/15/2022No
36ABC6188AEGP20ABCABC, JOHN10/23/202210/29/2022Yes
37ABC6188AEGP20ABCABC, JOHN10/30/202211/05/2022Yes
38ABC6188AEGP20ABCABC, JOHN11/06/202211/12/2022Yes
39ABC6188AEGP20ABCABC, JOHN11/13/202211/19/2022No
40ABC6188AEGP20ABCABC, JOHN11/13/202211/19/2022No
Sheet1
Cell Formulas
RangeFormula
G2:G40G2=IF(E2=E3-7,"Yes", IF(AND(E1=E2-7,A2<>A3),"Yes","No"))



Delete Data.xlsx
ABCD
1KeyFull NameWeeks WorkedConsecutive Weeks
2.8482., DEX4
3ABC6188ABC, JOHN29
Sheet2
 
Upvote 0
Is the result counting the Yes values per unique name?
If not, why is ABC, JOHN 29?
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top