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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hello

You are trying to multiply text.

Try this:

Code:
SUMPRODUCT((MID('Week 29'!B11:B54,4,3)*1)*('Week 29'!F11:F54))
 
Upvote 0
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.
 
Upvote 0
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)
 
Upvote 0
Code:
SUMPRODUCT((MID('Week 29'!B11:B54,4,3)="999")*'Week 29'!F11:F54)
 
Upvote 0

Forum statistics

Threads
1,217,449
Messages
6,136,699
Members
450,025
Latest member
Beginner52

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