countif but only if its a pair

Ramballah

Active Member
Joined
Sep 25, 2018
Messages
334
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table that goes as follows

ABCDEFG
2112112
1211211
1111211
Now this is a miniature and simplified version obviously but it's enough for what I need.
I need a countif, if there are pairs next to each other. So for example B-C are a pair of 1's. I need to only count ONE 1. and not two 1's. I cant figure it out my self somehow. Pretty sure its got something to do with a right or left formula... but I can't figure it out. To also clarify, A3 is not a pair, its a single one. So that should not be counted. Sometimes you get four 1's in a row, that needs to be counted as 2 as there are 2pairs. if theres five or three 1's then it only gets counted as 1 or 2. Because it needs to only count in pairs...

I hope my explanation is enough,
Thanks in advance,
Ramballah
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
To be clear...If something has been paired then it doesn't get counted again. So Row 1 has 2 pairs. Row 2 has 2 pairs and row 3 has 3 pairs?
Are the columns dynamic, do they have headers and if so which row?
 
Upvote 0
To be clear...If something has been paired then it doesn't get counted again. So Row 1 has 2 pairs. Row 2 has 2 pairs and row 3 has 3 pairs?
Are the columns dynamic, do they have headers and if so which row?
Its about 32 columns i believe (i cant check now due to not being able to check for some time). Row 7 till beyond but i think i prefer it to have a countif formula on every row for that row. Because sometimes its just 5 rows sometimes 30. It also makes it easy for me to check which rows i need to inspect (as in rows with many pairs need inspection).
 
Upvote 0
Its about 32 columns i believe (i cant check now due to not being able to check for some time). Row 7 till beyond but i think i prefer it to have a countif formula on every row for that row. Because sometimes its just 5 rows sometimes 30. It also makes it easy for me to check which rows i need to inspect (as in rows with many pairs need inspection).
So it can also be split up into 6 columns, if that makes it easier. Then I can just do multiple formula's with just + ing each other. every 7th column is a special column anyway. So maybe this makes it easier?
 
Upvote 0
You didn't answer post#2. Read the questions again. Nobody can help you without clarifying.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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