Count cells in another column until an adjacent column contains text

dya

New Member
Joined
Apr 26, 2011
Messages
49
Ok, this one is sorta complicated, and I haven't been able to find a good answer. Also, not wanting to use macros, since this is a schedule and will need to be sent out to many people (some with mac office 08).

So I have 3 columns, set up like this:

Time | Name | Total hours
.25 | |
.5 | |
1.5 | Sally | 2.25
1 | |
.75 | |
1.25 | |
1 | Joe | 4.00

So, I need formulas for that 3rd column (C). It should sum the values of the 1st column (A) on the same row and up to the row below the one where column B is not blank.
i.e. for the cell to the right of Joe (C8), it should add cells A8,A7,A6,A5 and not add A4 or before (or any below), because it has found a non blank cell in B4 where Sally's block ends.
(also, it should return blank if the adjacent B cell (name) is blank, but i can do that part)

Thank you so much!!!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
That works very well, with 1 exception. If a person is only scheduled on one line, then the next person is scheduled on the next line, that next person's total hours come in as #REF!
 
Upvote 0
Ok, this one is sorta complicated, and I haven't been able to find a good answer. Also, not wanting to use macros, since this is a schedule and will need to be sent out to many people (some with mac office 08).

So I have 3 columns, set up like this:

Time | Name | Total hours
.25 | |
.5 | |
1.5 | Sally | 2.25
1 | |
.75 | |
1.25 | |
1 | Joe | 4.00

So, I need formulas for that 3rd column (C). It should sum the values of the 1st column (A) on the same row and up to the row below the one where column B is not blank.
i.e. for the cell to the right of Joe (C8), it should add cells A8,A7,A6,A5 and not add A4 or before (or any below), because it has found a non blank cell in B4 where Sally's block ends.
(also, it should return blank if the adjacent B cell (name) is blank, but i can do that part)

Thank you so much!!!
Try this...

Book1
ABC
1ValueNameTotal
217
38
438
597Sally160
618
787Joe105
891Biff91
929
1048
1138
1260
131
140Karen176
Sheet1

Formula entered in cell C2:

=IF(B2="","",SUM(A$2:A2)-SUM(C$1:C1))

Copy down as needed.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,484
Members
452,917
Latest member
MrsMSalt

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