Formula to find if any cells below A2 are equal to A2 and if so how many?

suprsnipes

Active Member
Joined
Apr 26, 2009
Messages
434
Is it possible to use a formula to look at up 20 rows to see how many rows are equal to the first from the top down?

An example;
Column A row 1: formula to look at the 20 rows below to see if cell A2 is equal to A3, A4, A5 and so on and if so return the value of how many cells are equal to A1 if any.

I would really appreciate any help with this.

Regards,
suprsnipes
 
Or You could use

=INDEX((FREQUENCY(IF(A1:A22=A1,ROW(A1:A22)),IF(A1:A22<>A1,ROW(A1:A22))),1)

Which is more obvious why it works - still entered as an array formula
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi,

I thought the suggested formula below would work and whilst it is helpful it's not exactly what I am after.

I want to know what the current streak is.

<TABLE cellSpacing=0 cellPadding=0 width=91 border=0><COLGROUP><COL style="WIDTH: 24pt; mso-width-source: userset; mso-width-alt: 1024" width=32><COL style="WIDTH: 23pt; mso-width-source: userset; mso-width-alt: 992" width=31><COL style="WIDTH: 21pt; mso-width-source: userset; mso-width-alt: 896" width=28></COLGROUP><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl63 style="WIDTH: 24pt; HEIGHT: 15pt" width=32 height=20>A1</TD><TD class=xl64 style="BORDER-LEFT: medium none; WIDTH: 23pt" align=right width=31>6</TD><TD class=xl65 style="BORDER-LEFT: medium none; WIDTH: 21pt" align=right width=28>3

</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 15pt" height=20>A2</TD><TD class=xl64 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 15pt" height=20>A3</TD><TD class=xl64 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A4</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>5</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A5</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A7</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>7</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A8</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A9</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A10</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>5</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A11</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>4</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A12</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>3</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A13</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>2</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A14</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>1</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A15</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A16</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>7</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A17</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>8</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A18</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A19</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>6</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD class=xl63 style="BORDER-TOP: medium none; HEIGHT: 14.25pt" height=19>A20</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none" align=right>2</TD><TD class=xl63 style="BORDER-TOP: medium none; BORDER-LEFT: medium none">

</TD></TR></TBODY></TABLE>



Can it be done?

Regards,
suprsnipes
Ok, does that mean the "current streak" starts from the top of the data range?

If so, try this...

Book1
A
16
26
36
4100
56
66
76
86
96
106
116
126
136
146
156
166
Sheet1

Array entered**:

=FREQUENCY(IF(A1:A16=A1,ROW(A1:A16)),IF(A1:A16<>A1,ROW(A1:A16)))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,693
Members
452,938
Latest member
babeneker

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