Find HW in a range and total the number that comes after an HW

impuce

New Member
Joined
Feb 2, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a spreadsheet that has numbers and "HW"numbers (HW02, HW07...) in the cells.
I need a formula that will find the HW in a range of cells and total the numbers that follows the HW.

I've tried this formula: SUMPRODUCT(TEXT(MID(B2:G9,FIND("HW",B2:G9&"HW")+2,3),"0;;;\0")) but it doesn't work. I've attached a sample image of what I'm looking for.

Thanks in advance.
 

Attachments

  • Sample.PNG
    Sample.PNG
    21.8 KB · Views: 9

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi & welcome to MrExcel.
How about
Excel Formula:
=SUMPRODUCT((LEFT(B2:G9,2)="HW")*(MID(B2:G9,3,100)))
 
Upvote 0
In that case can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Hi,
You could test
VBA Code:
=SUMPRODUCT((LEFT(B2:B9,2)="HW")*(RIGHT(B2:B9,2)*1))
 
Upvote 1
Solution
Could you ever have a 3 digit number after the HW?
 
Upvote 0
Fluff is 100% right ...!!!

To be on the safe side
Excel Formula:
=SUMPRODUCT((LEFT(B2:B9,2)="HW")*(SUBSTITUTE(B2:B9,"HW","")*1))
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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