Select multiple cells to perform product

Marcrg

New Member
Joined
Oct 26, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello



Help!



Is there a formula/function that will enable me to find the product of all the values between two of the dates. for example, in the table below I may need it for from 2020 to 2022 so I'll need a formula that will give me 108.6*109.4*117.1.



DateValue
01/03/2022117.1
01/03/2021109.4
01/03/2020108.6
01/03/2019107
01/03/2018105
01/03/2017102.5
01/03/2016100.2
01/03/201599.7
01/03/201499.7
01/03/201398.1
01/03/201295.4


I effectively need something where I can tell it the two dates, and it will give me the product of all the values between those two dates. I thought it would be as easy as using the CELL function to get the cell names into the PRODUCT function but I can't seem to get that to work



Sorry if I'm not making this clear - any help will be greatly appreciated!



Thanks!
 
That will give the sum, not the product. ;)
Yess 😁

OK then my suggestion will be:
Excel Formula:
=PRODUCT(IF((YEAR(A2:A12)>=2020)*(YEAR(A2:A12)<=2022),B2:B12))
But this is an array formula. Just hitting Enter is not enough.
Paste the code and press Ctrl+Shift+Enter together.
 
Upvote 0
Solution

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Yess 😁

OK then my suggestion will be:
Excel Formula:
=PRODUCT(IF((YEAR(A2:A12)>=2020)*(YEAR(A2:A12)<=2022),B2:B12))
But this is an array formula. Just hitting Enter is not enough.
Paste the code and press Ctrl+Shift+Enter together.
That works! Thank you so much :)
 
Upvote 0
If that works did you put the two years into E2 & E3 like I showed with my formula?
 
Upvote 0
Did you just put the year or an actual date?
 
Upvote 0
Odd, but at least you have a working solution. :)
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,091
Latest member
gaurav_7829

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