A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Let's say the number of cells to include is in Z1. You can use
=PRODUCT(OFFSET(A1,0,0,1,Z1))
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a challenge in using the "Product" function with "offset".
Let's assume I have a single row with a sequence of returns across each of 10 columns:
1.01 1.02 1.03 1.04 1.05 1.02 1.034 1.08 1.02 1.24 4
I wish to calculate the product of the first values, for example; more importantly, I wish to be able to change the # of values to be included in the "product" function. For example, I wish to be able to set the # of values as a variable (see the last value in the row) so that the function calculates as follows: product(a1:d1) -- i.e. the first 4 values. Similarly, if the value in the last column is 6, then I wish to calculate product (a1:f1:) where the # of values included in the PRODUCT function is determined by the value in a specific cell. There is where I see the use of the "offset" function in some fashion, but I don't know how to do this.
Any suggestions?
Thanks.
E
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Let's say the number of cells to include is in Z1. You can use
=PRODUCT(OFFSET(A1,0,0,1,Z1))
Assuming 4 is in L1 and your range is in A1:J1, use below formula -
=PRODUCT(A1:INDEX(A1:J1,L1))