Excel 2016 count the last group of consecutive occurrences in a row

Gregory123987

New Member
Joined
Jun 23, 2020
Messages
33
Office Version
  1. 2016
Platform
  1. Windows
I have been searching for an example that can help me with what I am trying to do here. I want to find the number of consecutive populated cells from the right. If the cell is blank, then count the rest of the cells. I found several examples on finding consecutive cells, but none quite fit what I am looking for. I am not an advanced enough user to fully appreciate what you help me with. I would prefer a non-VBA solution to keep the workbook macro-free. Thank you for looking at my little problem.

This is a mock up showing what the answers should be to help to explain it.
The formula would go in the Result column and should have the range 1 to 31.
In row Person 1, the result should be 0 since column 31 is blank.
In row Person 2, the result should be 6 because there are 6 consecutive cells that are not blank.

Day
1​
2​
3​
4​
5​
6​
7​
8​
9​
10​
11​
12​
13​
14​
15​
16​
17​
18​
19​
20​
21​
22​
23​
24​
25​
26​
27​
28​
29​
30​
31​
Result
Person 1
5​
64130441056130441405610510
Person 243414051504314051504310441226
Person 34011443
Person 45451505150541505150541404414413
Person 565140541506514054150651404516628
Person 644510414044104140444030
Person 7104110410
Person 856150651551506515513044442
 
You could use MAXIFS function that would not require CTRL-SHIFT-ENTER.

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1Day12345678910111213141516171819202122232425262728293031Result
2Person 1564130441056130441405610510
3Person 243414051504314051504310441226
4Person 34011443
5Person 45451505150541505150541404414413
6Person 565140541506514054150651404516628
7Person 644510414044104140444030
8Person 7104110410
9Person 856150651551506515513044442
Sheet1
Cell Formulas
RangeFormula
AG2:AG9AG2=31-MAXIFS($B$1:$AF$1,B2:AF2,"")
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

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