Sum specific cells based on value in another cell.

ascriver

New Member
Joined
Aug 16, 2019
Messages
1
I would like to create a formula to automatically add the total hours per labeled time block based on the text above it. For example, I would like the formula to add the value in F26 based on the text in E24. to Does anyone know if this is possible, and if so what formula should I use? Please help!


mtou4p.png
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Welcome to the MrExcel forum.

For future reference, it's better to use one of the HTML tools (see my signature) to show your data. It's much easier for the helpers here to copy that onto their test spreadsheets than it is for them to actually have to retype everything. I normally wouldn't do it either, but I had some free time.

See if this works for you:


Excel 2012
BCDEFGHIJKL
247-L7-LKASKAS
25Time InTotal8:00 AMTotal7:40 AMTotal8:00 AMTotal8:00 AMTotal
26Time Out0:0010:00 AM2:009:30 AM1:501:00 PM5:0012:00 PM4:00
27KASKASKAS7-L
28Time InTotal10:00 AMTotal9:30 AMTotal2:00 PMTotal1:00 PMTotal
29Time Out0:0012:00 PM2:0012:00 PM2:303:30 PM1:303:30 PM2:30
307-L7-L7-LKAS
31Time InTotal1:00 PMTotal1:00 PMTotal3:30 PMTotal3:30 PMTotal
32Time Out0:002:00 PM1:002:00 PM1:005:00 PM1:305:00 PM1:30
33KASKAS
34Time InTotal2:00 PMTotal2:00 PMTotalTotalTotal
35Time Out0:005:00 PM3:004:40 PM2:400:000:00
36Total
37KAS7-L
3822:109:50

<tbody>
</tbody>
Sheet8


Worksheet Formulas
CellFormula
D38=SUMIF($E$24:$K$34,D37,$F$26:$L$36)
F38=SUMIF($E$24:$K$34,F37,$F$26:$L$36)

<tbody>
</tbody>

<tbody>
</tbody>




Also, note that merged cells can be really bad. Formulas often don't play nice with them. Using "Center across selection" is often better.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,554
Members
448,970
Latest member
kennimack

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