SUMPRODUCT help - basic

krispatterson

Board Regular
Joined
Apr 28, 2017
Messages
51
Hi guys

Struggling with what I think should be fairly easy to resolve... Advices please!

Data:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]DATES[/TD]
[TD]NAMES[/TD]
[TD]£ FIGURES[/TD]
[TD][/TD]
[TD]01/11/16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

The formula I want in F1:

> looks for all dates in Column A from E1 + 12m (so, 01/11/16 to 01/11/17)
> looks for a specific name in Column B (ie, John)
> adds up the figures based on that criteria.


What I tried was:
=SUMPRODUCT(--(YEAR($A$3:$A$20000)=YEAR($E$1)*($B$3:$B$20000="*john*")*$C$3:$C$20000))


But that's returning a '0' result in all circumstances - I've obviously got it wrong!

Any advice welcomed please :)

Thanks
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
2 probems.

1. Misplaced )
=SUMPRODUCT(--(YEAR($A$3:$A$20000)=YEAR($E$1)*($B$3:$B$20000="*john*")*$C$3:$C$20000))
shoul be
=SUMPRODUCT(--(YEAR($A$3:$A$20000)=YEAR($E$1))*($B$3:$B$20000="*john*")*$C$3:$C$20000)

2. Wildcards don't work in sumproduct ($B$3:$B$20000="*john*")
That will literally look for the asterisks in the string of column B.
You'd have to do
(ISNUMBER(SEARCH("john",$B$3:$B$20000)))
 
Last edited:
Upvote 0
Thanks both - but no longer need this as I've been made redundant from the job I needed it for!! :(

Never mind, onwards and upwards :eeek:
 
Upvote 0

Forum statistics

Threads
1,223,981
Messages
6,175,768
Members
452,668
Latest member
mrider123

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