Sum a vertical range if it is matching a horizontal range

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,434
Hello All,

I have something like this:
6050106:50 OFFOFF605066050960506605096050615:36
6050209:15 0:000:0010:265:1010:265:1010:2641:38
6050308:45
6050408:45
6050509:16
6050610:26
6050710:20
6050807:35
6050905:10
6051008:15
6100107:30
6100204:00
6100305:00
6100405:30
6100507:30
6100609:30
6200104:00
6200204:00
6200304:00
6200404:30
6200504:30
6200607:30
6200708:30
6200808:00
6200907:30
6201008:30
OFF00:00

<colgroup><col><col><col><col span="7"><col></colgroup><tbody>
</tbody>

The formula I have used is :
Code:
{=SUM(IF(ISNUMBER(MATCH($B$2:$B$27,$E$2:$K$2,0)),$C$2:$C$27))}
with ctrl+shift+enter
But I am getting the wrong answer 15:36. How can I change the formula to get correct answer of 41:38

Regards and many Thanks

Asad
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Got it, :)
Simple formula
Code:
{=SUM(IF($B$2:$B$28=E2:K2,$C$2:$C$28))}
did the trick.
Sometimes you have to take a simpler path rather than a complicated one.
:)
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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