Extra criteria in IF statement needed

ollyhughes1982

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

Start.jpg
End.jpg


Re the screenshots above, I currently have the below formula in BJ11:

=IF(C11="","",IF(OR(C11="",F11=F10),"",COUNT(UNIQUE($F$4:F11))))

This is however missing something. I also need to add in the criteria that a new number needs to be added to the sequence if C11 is different to C10. This is because it is possible to volunteer at two separate parkruns on the same day. So, the numbering needs to account for situations where the date is the same, but the venue is different.

I would expect to see 6 in cell BJ11 and 7 in BJ12. This is because I volunteered later in the day on 29/08/2021 at a different venue (Cwmbran). For the first three roles I did that day, they were all at Newport junior parkrun.

N.B. An 'Occasion' signifies each unique venue that is volunteered at on a particular date. hence having Newport junior and Cwmbran on 29/08/2021 equals two different occasions (6th and 7th).

Thanks in advance,

Olly.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
When you say your formula is "missing something" what do you mean by that?

Looking at the formula itself, it looks like you are testing for the same condition more than once and it could be simplified to the following for a unique count of values:
=IF(or(C11="",F11=F10),"",SUM(IF(FREQUENCY($F$4:F11,$F$4:F11)>0,1)))
 
Upvote 0
When you say your formula is "missing something" what do you mean by that?

Looking at the formula itself, it looks like you are testing for the same condition more than once and it could be simplified to the following for a unique count of values:
=IF(or(C11="",F11=F10),"",SUM(IF(FREQUENCY($F$4:F11,$F$4:F11)>0,1)))
Hi and thanks for responding. The bit I need to add in is as follows:

A new number needs to be added to the sequence if C11 is different to C10. This is because it is possible to volunteer at two separate parkruns on the same day. So, the numbering needs to account for situations where the date is the same, but the venue is different. In my example, I have 4 roles undertaken on 29/08/2021, but the first three were at Newport junior and the fourth was at Cwmbran, later in the day. So the 5 in BJ8 is correct, but then in stead of a blank in BJ11 there should be a 6 and then a 7 in BJ12. This is because each set of roles completed at a particular venue, on a particular day is called an ‘Occasion’. So, on the 28/09/2021, Newport junior was the first occasion and Cwmbran was the second occasion. Therefore, occasions 5 and 6 both took place on the same date. Three roles at Newport junior and one role at Cwmbran.

Thanks again.
 
Upvote 0
I have now solved this. I added a helper column (BJ) that combined the date (F) and first instance of event (BH) columns and then doing a sumproduct count on non-blank cells. I then did my numbering in column BK.

Screenshot 2021-12-23 at 18.37.52.png


Thanks again.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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