# counting cells between blank cells

#### nlmfao

##### New Member
hi,

I have column A containing values of 1 amongst blank cells and I’m looking for a formula to sum up the cells containing “1” between any given 2 blank cells, displayed in Col B. Does anyone have any suggestions?

Example below;

 col A col B 1 1 1 3 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 24

<tbody>
</tbody>

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the board.

Enter this in B2 and copy down:

=IF(A2<>"","",SUM(\$A\$1:A1)-SUM(\$B\$1:B1))

Thank you, much appreciated!!

Replies
8
Views
124
Replies
1
Views
160
Replies
1
Views
113
Replies
1
Views
37
Replies
2
Views
362

1,203,384
Messages
6,055,115
Members
444,763
Latest member
Jaapaap

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

### Which adblocker are you using?

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

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