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
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
How is this...
Book3
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1Day12345678910111213141516171819202122232425262728293031Result
2Person 1564130441056130441405610510
3Person 243414051504314051504310441226
4Person 34011443
5Person 45451505150541505150541404414413
6Person 565140541506514054150651404516628
7Person 644510414044104140444030
8Person 7104110410
9Person 856150651551506515513044442
Sheet1
Cell Formulas
RangeFormula
AG2:AG9AG2=$AF$1-(MAX((B2:AF2="")*($B$1:$AF$1)))
 
Upvote 0
Not too good. I took this spreadsheet as is and created a new one pasting in cell A1 and the formulas in Column AG are all returning a #VALUE error.
 
Upvote 0
Not too good. I took this spreadsheet as is and created a new one pasting in cell A1 and the formulas in Column AG are all returning a #VALUE error.
Unfortunately when you paste cells from here into Excel , Excel often treats numbers as Text strings...
Replace the 1-31 in row 1 with numbers and see if that solves it
 
Upvote 0
Tried that. Re-pasted the formulas. With no luck. Same error.
1592967219061.png
1592967219061.png
 
Upvote 0
Edit the formula as you have done and press Ctrl Shift Enter... It may require treatment like an array
 
Upvote 0
I'm an application developer / help desk tech / Computer Repairman / network administrator. In other words the IT dept for my company. I always follow through when I am looking for a solution to my problem. And not only because it is to my benefit.
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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