Possible COUNTIF solution

ollyhughes1982

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

I wonder if anyone might be able to help with some formulas, please. I have an existing table (columns A & B) that work perfectly, counting how many runs I have completed at each different parkrun venue. However, I would now like to some extra columns (C-G), but am not sure of how I calculate them. At the moment I have inserted the formulas that calculate what I want, but for all events, whereas I want them to calculate for the relevant event in that row.

So, what I essentially want to do is to keep the same calculation for each of the C-G columns, but with something added into the formula so that it is calculated only for that particular row's event.

At present, I have the following in columns C-G, which calculate correctly, but for all events:
  • In A3: =IFERROR(UNIQUE(FILTER('All Completed Runs'!C3:C2002,'All Completed Runs'!E3:E2002<>"")),"")
  • In B3: =IF(A3="","",COUNTIF('All Completed Runs'!C:C,A3#))
  • In C3: =IF(A3="","",OFFSET(INDEX('All Completed Runs'!E3:E2002,MATCH(MAX('All Completed Runs'!E3:E2002),'All Completed Runs'!E3:E2002,FALSE)),0,21))
  • In D3: =IF(A3="","",IFERROR(TEXT(SMALL('All Completed Runs'!Z3:Z2002,COUNTIF('All Completed Runs'!Z3:Z2002,0)+1),"HH:MM:SS"),""))
  • In E3: =IF(A3="","",AVERAGE('All Completed Runs'!Z3:Z2002))
  • In F3: =IF(A3="","",MAX('All Completed Runs'!Z3:Z2002))
  • In G3: =IF(A3="","",IFERROR(MODE('All Completed Runs'!Z3:Z2002),"N/A - None / Multiple"))
Is it something really simple like just adding in a COUNTIF somewhere in each formula? I have tried a a few things, but without success.

Thanks in advance!

I have attached a link to the file via Google Drive:

parkrun - My parkrun Record (Oliver Hughes - A132324) WORKING.xlsx

Screenshot 2020-08-07 at 10.47.46.jpg

Also posted on Excel Forum: Possible COUNTIF solution
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Changing COUNTIF to COUNTIFS might work for some of the formulas by comparing A3 to a column with event names in the 'All events' sheet.

Formulas with no explanation have little meaning.

A couple of small tables (expected results and a small sample of the source data to show about 20 rows of only the relevant columns) posted using XL2BB would give far more meaning to your post than a screen capture and an attached file (which many users may not be able to download anyway).
 
Upvote 0
Hi. I have cut it down as small as I can and it is still over 5mb in file size. I have included a link to it, below:


What is Excel XL2BB?

I didn't originally do smaller version one because there are so many interconnects between worksheets etc. Bit of explanation as to the cells:
  • C3: This should provide the time for the last time I completed the event in column A
  • D3: This should provide the fastest (lowest) time out of all instances of the event in column A
  • E3: This should provide the average (mean) time for all instances of the event in column A
  • F3: This should provide the slowest (highest) time out of all instances of the event in column A
  • G3: This should provide the most occurring (mode) time for the event in column A, or enter "N/A - None / Multiple" if this doesn't apply
Hopefully the explanation helps.
 
Upvote 0
What is Excel XL2BB?
If you click the button on the reply toolbar, all will be revealed :)

I'm going to be offline for a bit, I'll check your thread later and look at the formulas for you then if it hasn't been resolved.
 
Upvote 0
If you click the button on the reply toolbar, all will be revealed :)

I'm going to be offline for a bit, I'll check your thread later and look at the formulas for you then if it hasn't been resolved.

Ah, I see, you have to download an add-in. I will give this a try
 
Upvote 0
MY parkruns - ALL COMPLETED RUNS - BY EVENT (VENUE)
Event (Venue)# CompletedLatest Event (Venue) Finishing TimeFastest Event (Venue) Finishing Time / Current Event (Venue) PBAverage Event (Venue) Finishing TimeSlowest Event (Venue) Finishing TimeMost Frequent Event (Venue) Finishing Time
Newport parkrun20:28:0700:24:410:26:220:28:07N/A - None / Multiple
Ashton Court parkrun1
Groe parkrun1
Gloucester North parkrun1


Source Sheet:

MY parkruns - ALL COMPLETED RUNS
Run #Event (Venue) Run #Event (Venue)CountryDate CompletedFinishing Position ## of FinishersBest Finishing Position #?Best Event (Venue) Finishing Position #?Gender Finishing Position ## of Gender FinishersBest Gender Finishing Position #?Best Event (Venue) Gender Finishing Position #?PB?Overall PB?Event (Venue) PB?PB Streak #First Timer?Assisted?Age GroupAge Group Finishing Position ## of Age Group FinishersBest Age Group Finishing Position #?Best Event (Venue) Age Group Finishing Position ?ClubTimeAge Grade %Best Age-Grade %?Best Event (Venue) Age-Grade %?Home Page LinkCourse Page LinkWeekday
 
Upvote 0
For D, E & F have a look at minifs, maxifs & averageifs
 
Upvote 0
For C, you can use the below formula

=INDEX('All Completed Runs'!$Z$3:$Z$2002,MATCH(A3&MAX(IF('All Completed Runs'!$C$3:$C$2002=A3,'All Completed Runs'!$E$3:$E$2002,0)),'All Completed Runs'!$C$3:$C$2002&'All Completed Runs'!$E$3:$E$2002,0))
 
Upvote 0
Or, using filter
=IF(A3="","",FILTER('All Completed Runs'!$Z$3:$Z$2002,('All Completed Runs'!$C$3:$C$2002=A3)*('All Completed Runs'!$E$3:$E$2002=MAXIFS('All Completed Runs'!$E$3:$E$2002,'All Completed Runs'!$C$3:$C$2002,A3))))
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

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