(One more before I quit for the day and what a gloomy day here in England)
I am counting the occurrences of items on a sheet and outputting by counts each day:
countif of unique items by date:
=COUNTIFS(Sheet22!C:C,B5#,Sheet22!A:A,Sheet21!E4:Sheet21!I4)
- b5# is list of unique items on Sheet22 column c
- sheet 21 e4:i4 is a row of dates.
- range c5:c22 is a static starting balance for each item in b5:b22
The formula above ouputs the count correctly but what I want is the rolling count i.e.
jackdaw starts at 5 and there are in the example none for each so for each date: 5, 5, 5, etc rather than 0,0,0,etc
Further down coat has 44 starting and rolling count would be: 44, 43, 43, 43, etc rather than 0,1,0,0,etc
I would like to wrap the formula above in another formula to achieve this byrow seemed most obvious but doesn't work ???
Seems tricky - I am fairly new to O365 and dynamic functions - but that's no excuse
- I am determined to learn
Thanks in advance and thanks for looking
I am counting the occurrences of items on a sheet and outputting by counts each day:
countif of unique items by date:
=COUNTIFS(Sheet22!C:C,B5#,Sheet22!A:A,Sheet21!E4:Sheet21!I4)
- b5# is list of unique items on Sheet22 column c
- sheet 21 e4:i4 is a row of dates.
- range c5:c22 is a static starting balance for each item in b5:b22
The formula above ouputs the count correctly but what I want is the rolling count i.e.
jackdaw starts at 5 and there are in the example none for each so for each date: 5, 5, 5, etc rather than 0,0,0,etc
Further down coat has 44 starting and rolling count would be: 44, 43, 43, 43, etc rather than 0,1,0,0,etc
I would like to wrap the formula above in another formula to achieve this byrow seemed most obvious but doesn't work ???
Seems tricky - I am fairly new to O365 and dynamic functions - but that's no excuse

Thanks in advance and thanks for looking
test.xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | |||
4 | new statring balance | 31.01.2025 | 02/02/25 | 04/02/25 | 05/02/25 | 06/02/25 | ||||
5 | jackdaw | 5 | 0 | 0 | 0 | 0 | 0 | 0 | ||
6 | orange | 7 | 0 | 0 | 0 | 0 | 0 | 0 | ||
7 | lemon | 8 | 0 | 0 | 0 | 0 | 0 | 0 | ||
8 | coat | 44 | 1 | 0 | 1 | 0 | 0 | 0 | ||
9 | jockdaw | 1 | 0 | 0 | 0 | 0 | 0 | 0 | ||
10 | tree | 3 | 0 | 0 | 0 | 0 | 0 | 0 | ||
11 | hat | 99 | 0 | 0 | 0 | 0 | 0 | 0 | ||
12 | treeflower | 11 | 0 | 0 | 0 | 0 | 0 | 0 | ||
13 | flower | 14 | 0 | 0 | 0 | 0 | 0 | 0 | ||
14 | river | 63 | 0 | 0 | 0 | 0 | 0 | 0 | ||
15 | green albatross | 12 | 0 | 0 | 0 | 0 | 0 | 0 | ||
16 | garage | 14 | 0 | 0 | 0 | 0 | 0 | 0 | ||
17 | shoes | 32 | 0 | 0 | 0 | 0 | 0 | 0 | ||
18 | yellow blackbird | 7 | 0 | 0 | 0 | 0 | 0 | 0 | ||
19 | alfa romeo | 18 | 2 | 0 | 1 | 1 | 0 | 0 | ||
20 | belt | 1 | 1 | 0 | 1 | 0 | 0 | 0 | ||
21 | red robin | 1 | 0 | 0 | 0 | 0 | 0 | 0 | ||
22 | house | 7 | 0 | 0 | 0 | 0 | 0 | 0 | ||
Sheet21 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E4 | E4 | =B3 |
F4 | F4 | =E4+2 |
G4 | G4 | =E4+4 |
H4:I4 | H4 | =G4+1 |
B5:B22 | B5 | =DROP(UNIQUE(Sheet22!C:C,,FALSE),-1) |
D5:D22 | D5 | =BYROW(E5#,LAMBDA(row,SUM(row))) |
E5:I22 | E5 | =COUNTIFS(Sheet22!C:C,B5#,Sheet22!A:A,Sheet21!E4:Sheet21!I4) |
Dynamic array formulas. |