Help extracting year & text for sumif or sum product

ehous31900

New Member
Joined
Dec 31, 2024
Messages
2
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I am trying to calculate sums off columns based on the year extracted from a Cell (month, day, year) and a cell with text ROUVY.

The application is tracking milage over many years extracting totals per year and extracting rouvy (indoor riding) from outdoor riding.

I have the formula working separately, However, I have not been able to combined them.
The following works:
=SUMPRODUCT((YEAR(B9:B24)=B1)*D9:D24)
=SUMPRODUCT(--(YEAR(B9:B24)=B1),D9:D24)
=SUMIF($A$9:$A10000,"ROU*",$D$9:D10000)

this does not work:
=SUMPRODUCT(IF(YEAR(B9:B24)=B1,1,0),IF(A9:A24="ROU*",1,0),D9:D24)

Thanks, Ed
 

Attachments

  • Screenshot 2024-12-31 112945.png
    Screenshot 2024-12-31 112945.png
    56 KB · Views: 10

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Welcome to the Board!

Try this:
Excel Formula:
=SUMPRODUCT(--(YEAR(B9:B24)=B1),--(LEFT(A9:A24,3)="ROU"),D9:D24)
 
Upvote 0
Hi, as an alternative, you could also try a SUMIFS() like this.

Excel Formula:
=SUMIFS(D9:D24,B9:B24,">="&DATE(B1,1,1),B9:B24,"<="&DATE(B1,12,31),A9:A24,"ROU*")
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0

Forum statistics

Threads
1,225,358
Messages
6,184,497
Members
453,236
Latest member
Siams

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