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.
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

shift-del

Well-known Member
Joined
Aug 28, 2009
Messages
516
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
516
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,843
Members
414,342
Latest member
K Darrell Smith

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