Formula to return value a certain number of times a value occurs in another cell

berimbau

New Member
Joined
Nov 22, 2016
Messages
1
Hi all,

I have a data set that looks like this:

Invoice Month
A01 Jan
A02 Jan
A03 Feb
A04 Feb
A05 Feb
A06 Feb
A07 Mar
A08 Mar
A09 Mar

I need to put "Include" in another column the for the first two invoices raised in the month, and "Exclude" for every invoice raised in that month after the first two. The data will be sorted by date raised (so the first invoices appearing in the month are the ones that need to say "Include"). It would need to look like this:

Invoice Month Include/Exclude
A01 Jan Include
A02 Jan Include
A03 Feb Include
A04 Feb Include
A05 Feb Exclude
A06 Feb Exclude
A07 Mar Include
A08 Mar Include
A09 Mar Exclude

Can anyone think of a formula I could use to populate the include/exclude column?

Thanks
berimbau
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Like this maybe


Excel 2010
ABC
1InvoiceMonthInclude/Exclude
2A01JanInclude
3A02JanInclude
4A03FebInclude
5A04FebInclude
6A05FebExclude
7A06FebExclude
8A07MarInclude
9A08MarInclude
10A09MarExclude
Sheet2
Cell Formulas
RangeFormula
C2=IF(COUNTIF($B$2:$B2,$B2)<=2, "Include", "Exclude")
 
Upvote 0

Forum statistics

Threads
1,216,152
Messages
6,129,168
Members
449,490
Latest member
TheSliink

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