MID Function

pells

Active Member
Joined
Dec 5, 2008
Messages
361
Is it possible to use the MID function within SUMPRODUCT, SUMIF or SUM?

I am trying to obtain the 4th character for the next 3 characters within a cell and to sum against them.

At the moment I have:

SUMPRODUCT(MID('Week 29'!B11:B54,4,3)*'Week 29'!F11:F54)

But keep getting a #VALUE! error.

Any help would be greatly received.

Many thanks.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

shift-del

Well-known Member
Joined
Aug 28, 2009
Messages
582
Office Version
  1. 365
Platform
  1. Windows
Hello

You are trying to multiply text.

Try this:

Code:
SUMPRODUCT((MID('Week 29'!B11:B54,4,3)*1)*('Week 29'!F11:F54))
 

pells

Active Member
Joined
Dec 5, 2008
Messages
361
Thanks for this.

I forgot to mention that the MID('Week 29'!B11:B54,4,3) needs to equal "999".

Do you know how to put this into the code?

Many thanks.
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Try this if column B is alphanumeric

=SUMIF('Week 29'!B11:B54,"???999*",'Week 29'!F11:F54)

...if it's numeric then

=SUMPRODUCT((MID('Week 29'!B11:B54,4,3)="999")+0,'Week 29'!F11:F54)
 

shift-del

Well-known Member
Joined
Aug 28, 2009
Messages
582
Office Version
  1. 365
Platform
  1. Windows
Code:
SUMPRODUCT((MID('Week 29'!B11:B54,4,3)="999")*'Week 29'!F11:F54)
 

pells

Active Member
Joined
Dec 5, 2008
Messages
361
Perfect!

Many thanks for all your help and the time to help me out.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,707
Messages
5,833,241
Members
430,199
Latest member
Petty queen

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
Top