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!


 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
9,890
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:

Watch MrExcel Video

Forum statistics

Threads
1,102,081
Messages
5,484,556
Members
407,454
Latest member
moomen1999

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top