# Max frequency for consecutive text multiple condition

#### yogeshDD

##### New Member
Hi

I need the formula for max frequency or similar to this, Problem statement is - I have an attendance record of 1 month in which I need to calculate a repeated occurrence. let's say.. if Mr. ABC is present (P) from 1-April to 7 April, and then on his Week off day he was present then the outcome for the present should be 8.

I'm using this formula but it is giving me output only for P

ArrayFormula((MAX(FREQUENCY(IF(B2:H2="P",COLUMN(B2:H2)),IF(B2:H2<>"P",COLUMN(B2:H2))))))

 Name 1 May 2 May 3 May 4 May 5 May 6 May 7 May Total P (Consecutive) Result Total P (ConsecutiveP+WOP) final result ABC P P P WOP P A P 3 5

### Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

#### Fluff

##### MrExcel MVP, Moderator
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFGHIJ
1Name01-May02-May03-May04-May05-May06-May07-MayTotal P (Consecutive)Total P (ConsecutiveP+WOP)
2ABCPPPWOPPAP35
Main
Cell Formulas
RangeFormula
J2J2=MAX(FREQUENCY(IF(ISNUMBER(SEARCH("P",B2:H2)),COLUMN(B2:H2)),IF(ISERROR(SEARCH("P",B2:H2)),COLUMN(B2:H2))))
Press CTRL+SHIFT+ENTER to enter array formulas.

Replies
3
Views
229
Replies
11
Views
293
Replies
3
Views
775
Replies
7
Views
364
Replies
4
Views
210

Threads
1,141,314
Messages
5,705,689
Members
421,406
Latest member
kluna90

### 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

### 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