Possibly countifs for two helper columns

Status
Not open for further replies.

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
677
Office Version
  1. 365
Platform
  1. MacOS
Hi all,

I have the ‘All Completed VS’ worksheet (screenshot below and link attached). The worksheet shows all of the parkruns at which I have volunteered and the volunteering role that I completed at each. I am looking to do some calculations on this worksheet, but cannot figure out how to calculate the two helper columns (highlighted in orange) that I need.


Screenshot 2021-11-16 at 10.48.48.jpg


The calculations I want to make are in the following two columns:

1. AZ ‘Unique Role # at this Unique Event (Venue)’
- I want this to number the column each time that a new role is completed at each particular unique event (venue). e.g In my example, there should be a ‘1’ in AZ4 (first Marshal role at Newport), a blank in AZ5, a 1 in AZ6 (first Finish Token Support role at Riverfront), a 1 in AZ7 (first Pre-Event Setup role at Newport), a 1 in AZ8 (first Photographer role at Riverfront) and so on…


2. BA ‘Unique Role Stint # at this Unique Event (Venue)’
- I want this to number the column each time that a new stint for each particular unique role is completed at each particular unique event (venue). e.g In my example, there should be a ‘1’ in AZ4 (first Marshal role at Newport), a ‘2’ in AZ5 (second Marshal role at Newport), a 1 in AZ6 (first Finish Token Support role at Riverfront), a 1 in AZ7 (first Pre-Event Setup role at Newport), a 1 in AZ8 (first Photographer role at Riverfront) and so on…

Link: parkrun - Volunteering Example (Slimmed).xlsx

Thanks in advance,

Olly.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
For 1.
I have used
=IF(COUNTIFS($C$4:C4,C4,$E$4:E4,E4)=1,1,"")

NOT the $ fixing the cell at the first entry and also then relative for the first entry so as the formula copies down, it only counts the row its on and above - NOT below
This assumes the dates are sorted in the order you attended otherwise different solution needed maybe with a MIN(DATE)

and 2.
just a
=COUNTIFS($C$4:C5,C5,$E$4:E5,E5)
This assumes the dates are sorted in the order you attended otherwise different solution needed maybe with a MIN(DATE)

i have not used any dates, as i assume each entry is unique occurrence and you would not duplicate, and the spreadsheet is sorted/ordered by date

parkrun - Volunteering Example (Slimmed).xlsx
CEFAZBA
3Event (Venue)RoleDate CompletedUnique Role # at this Unique Event (Venue)Unique Role Stint # at this Unique Event (Venue)
4Newport parkrunMarshal25/12/201711
5Newport parkrunMarshal30/12/2017 2
6Riverfront parkrunFinish Token Support01/01/201811
7Newport parkrunPre-Event Setup01/01/201811
8Riverfront parkrunPhotographer06/01/201811
9Newport parkrunBarcode Scanning13/01/201811
10Newport parkrunFinish Token Support20/01/201811
11Newport parkrunNumber Checker27/01/201811
12Riverfront parkrunBarcode Scanning03/02/201811
13Riverfront parkrunNumber Checker17/02/201811
14Riverfront parkrunNumber Checker24/02/2018 2
15Newport parkrunNumber Checker24/03/2018 2
16Newport parkrunNumber Checker12/05/2018 3
17Penallta parkrunNumber Checker26/05/201811
18Penallta parkrunFinish Token Support02/06/201811
19Newport parkrunNumber Checker09/06/2018 4
20Penallta parkrunEvent Day Course Check23/06/201811
21Penallta parkrunFinish Token Support30/06/2018 2
22Bryn Bach parkrunBarcode Scanning07/07/201811
23Newport parkrunNumber Checker14/07/2018 5
24Riverfront parkrunFinish Token Support21/07/2018 2
25Severn Bridge parkrunPre-Event Setup11/08/201811
26Cwmbran parkrunPhotographer18/08/201811
27Pontypool parkrunBarcode Scanning25/08/201811
28Newport parkrunMarshal08/09/2018 3
29Pontypridd parkrunMarshal29/09/201811
30Pontypridd parkrunCar Park Marshal20/10/201811
All Completed VS
Cell Formulas
RangeFormula
AZ4:AZ30AZ4=IF(COUNTIFS($C$4:C4,C4,$E$4:E4,E4)=1,1,"")
BA4:BA30BA4=COUNTIFS($C$4:C4,C4,$E$4:E4,E4)
 
Last edited:
Upvote 0
For 1.
I have used
=IF(COUNTIFS($C$4:C4,C4,$E$4:E4,E4)=1,1,"")

and 2.
just a
=COUNTIFS($C$4:C5,C5,$E$4:E5,E5)

i have not used any dates, as i assume each entry is unique occurance and you would not duplicate

parkrun - Volunteering Example (Slimmed).xlsx
CEFAZBA
3Event (Venue)RoleDate CompletedUnique Role # at this Unique Event (Venue)Unique Role Stint # at this Unique Event (Venue)
4Newport parkrunMarshal25/12/201711
5Newport parkrunMarshal30/12/2017 2
6Riverfront parkrunFinish Token Support01/01/201811
7Newport parkrunPre-Event Setup01/01/201811
8Riverfront parkrunPhotographer06/01/201811
9Newport parkrunBarcode Scanning13/01/201811
10Newport parkrunFinish Token Support20/01/201811
11Newport parkrunNumber Checker27/01/201811
12Riverfront parkrunBarcode Scanning03/02/201811
13Riverfront parkrunNumber Checker17/02/201811
14Riverfront parkrunNumber Checker24/02/2018 2
15Newport parkrunNumber Checker24/03/2018 2
16Newport parkrunNumber Checker12/05/2018 3
17Penallta parkrunNumber Checker26/05/201811
18Penallta parkrunFinish Token Support02/06/201811
19Newport parkrunNumber Checker09/06/2018 4
20Penallta parkrunEvent Day Course Check23/06/201811
21Penallta parkrunFinish Token Support30/06/2018 2
22Bryn Bach parkrunBarcode Scanning07/07/201811
23Newport parkrunNumber Checker14/07/2018 5
24Riverfront parkrunFinish Token Support21/07/2018 2
25Severn Bridge parkrunPre-Event Setup11/08/201811
26Cwmbran parkrunPhotographer18/08/201811
27Pontypool parkrunBarcode Scanning25/08/201811
28Newport parkrunMarshal08/09/2018 3
29Pontypridd parkrunMarshal29/09/201811
30Pontypridd parkrunCar Park Marshal20/10/201811
All Completed VS
Cell Formulas
RangeFormula
AZ4:AZ30AZ4=IF(COUNTIFS($C$4:C4,C4,$E$4:E4,E4)=1,1,"")
BA4:BA30BA4=COUNTIFS($C$4:C4,C4,$E$4:E4,E4)
That's brilliant. Thanks!
 
Upvote 0
you are welcome, I added a note re sort order and dates
 
Upvote 0
Yes, they are always entered / sorted by date. (y) When I've added into my version I get some zeroes at the bottom, is there a way for the cells to appear blank when there is no entry in columns C / E? Also, I think the Merthyr column BA78 should be 1? As this is the first time First Timers Briefing is completed at Merthyr?

Thanks again.
Screenshot 2021-11-16 at 11.41.54.jpg
 
Upvote 0
I don't think it's actually working in the way I wanted. I think it's my rubbish explanation. I will try and manually populate so you can see what I am after.
 
Upvote 0
Crossed Posted, i await the update

Mine shows as 1

What formula do you have in BA , does it start with the correct rows ?

Do all the other values show up correctly

to stop blank cells showing a count of zero
then
try
=IF(C4="","",COUNTIFS($C$4:C4,C4,$E$4:E4,E4))

I have added to Dropbox, NOTE only stays on for a week, so you can see the whole example - XL2BB to many cells to show

BUT a small sample here as well for forum future searches
parkrun - Volunteering Example (Slimmed) - ETAF.xlsx
CEFAZBA
3Event (Venue)RoleDate CompletedUnique Role # at this Unique Event (Venue)Unique Role Stint # at this Unique Event (Venue)
4Newport parkrunMarshal25/12/201711
5Newport parkrunMarshal30/12/2017 2
6Riverfront parkrunFinish Token Support01/01/201811
7Newport parkrunPre-Event Setup01/01/201811
8Riverfront parkrunPhotographer06/01/201811
9Newport parkrunBarcode Scanning13/01/201811
10Newport parkrunFinish Token Support20/01/201811
11Newport parkrunNumber Checker27/01/201811
12Riverfront parkrunBarcode Scanning03/02/201811
13Riverfront parkrunNumber Checker17/02/201811
14Riverfront parkrunNumber Checker24/02/2018 2
15Newport parkrunNumber Checker24/03/2018 2
16Newport parkrunNumber Checker12/05/2018 3
17Penallta parkrunNumber Checker26/05/201811
All Completed VS
Cell Formulas
RangeFormula
AZ4:AZ17AZ4=IF(COUNTIFS($C$4:C4,C4,$E$4:E4,E4)=1,1,"")
BA4:BA17BA4=IF(C4="","",COUNTIFS($C$4:C4,C4,$E$4:E4,E4))
 
Upvote 0
Hi. I have just uploaded a version with the cells entered manually, to illustrate what I'm after. If you look at the spreadsheet in a filtered view, with venues selected where i have done quite a few (Newport, Penallta, Riverfront), it illustrates it best. I've attached screenshot examples for Penallta and Riverfront. You can see that whilst there won't always be a number in AZ, there will always be one in BA, as this is the count for AZ.

Link for this manually populated version is here: parkrun - Volunteering Example (Slimmed)_v2.xlsx

Thanks,

Olly.
Penallta.jpg

Riverfront.jpg
 
Upvote 0
the linked file is not the same as the illustrations

i just thought you wanted a 1 or blank in column AZ - the linked file has 1,2,3,4,5

parkrun - Volunteering Example (Slimmed)_v2.xlsx
CEFAZBA
3Event (Venue)RoleDate CompletedUnique Role # at this Unique Event (Venue)Unique Role Stint # at this Unique Event (Venue)
4Newport parkrunMarshal25/12/201711
5Newport parkrunMarshal30/12/20172
6Riverfront parkrunFinish Token Support01/01/201811
7Newport parkrunPre-Event Setup01/01/201821
8Riverfront parkrunPhotographer06/01/201811
9Newport parkrunBarcode Scanning13/01/201831
10Newport parkrunFinish Token Support20/01/201841
11Newport parkrunNumber Checker27/01/201851
12Riverfront parkrunBarcode Scanning03/02/201811
13Riverfront parkrunNumber Checker17/02/201811
All Completed VS



I have copied your manual entries into the 2 columns marked manual
added the formulas as before in first 2 columns
then added a comparison of the calc and manual
and filtered for Riverfront parkrun

Event (Venue)RoleDate CompletedUnique Role # at this Unique Event (Venue)Unique Role Stint # at this Unique Event (Venue)ManualManualCompareCompare
Riverfront parkrunFinish Token Support01/01/20181111TRUETRUE
Riverfront parkrunPhotographer06/01/20181111TRUETRUE
Riverfront parkrunBarcode Scanning03/02/20181111TRUETRUE
Riverfront parkrunNumber Checker17/02/20181111TRUETRUE
Riverfront parkrunNumber Checker24/02/201822TRUETRUE
Riverfront parkrunFinish Token Support21/07/201822TRUETRUE
Riverfront parkrunMarshal25/12/20181111TRUETRUE
Riverfront parkrunMarshal01/01/201922TRUETRUE
Riverfront parkrunEvent Day Course Check19/01/20191111TRUETRUE
Riverfront parkrunEvent Day Course Check27/04/201922TRUETRUE
Riverfront parkrunRun Report Writer28/09/20191111TRUETRUE
Riverfront parkrunTail Walker16/11/20191111TRUETRUE
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,133
Messages
6,123,235
Members
449,092
Latest member
SCleaveland

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