The OFFSET function is a built-in function in Microsoft Excel that allows you to reference a cell or a range of cells that are located a specified number of rows and columns away from a starting cell or range. The OFFSET function is commonly used in dynamic formulas and charts where the range of data changes frequently.
Please follow the directions given below, which include downloading the Excel worksheet required to perform the challenge tasks. Once you have completed the download, proceed to take the challenge and test your skills.
In cell K6, create a formula utilizing the OFFSET function to ascertain the sum value for the chosen field value (I6 cell), taking into account the start and end dates (K1:K3 cells).
Reply to this post with your formula code and solution file. Please be sure to blur or hide your formula code.
Having gone through the task requirement all over again, I understood there’s no need to consider product as a field. Then I’ll stick with my initial formula. Which is to sum values rather than looking for ways to count products.
MATCH(I6,A1:G1,0) - This returns the relative position of the chosen field in I6 within the A1:G1.
OFFSET is used to return ranges based on the starting date and end date.
There are also several ways to go about this as well just like in the other workouts. Ideally I would have gone with an XLOOKUP, or other dynamic array formulas as it also return ranges. OFFSET is known to be volatile but it’s still a powerful function.
One alternative way to solve this without Offset is:
I also understand there are variety of ways to achieve that with new formulas. I am big fan of modern Excel too. But I think these workouts want to strengthen our knowledge of Excel either classic or modern.
Also, these alternatives are not dynamic with the selected field.
Thank you for participating in the Excel Challenge related to Name Manager, Data Validation and Indirect Function! I hope you found this challenge to be a fun and engaging way to improve your Excel skills and learn more about how to perform conditional summation in Excel.
This formula calculates the sum of a selected field (I6) by using the OFFSET function to determine the range. The starting point for the range is cell A1, and the rows are determined by finding the start date (K1) in the A2:A366 range using the MATCH function. The columns are determined by finding the field name (I6) in the header row of the table (B1:G1) using MATCH. The height of the range is determined by subtracting the start date (K1) from the end date (K3) and adding 1.
@IlgarZarbaliyev - I never knew about the OFFSET() function, a new learning for me. Thanks for sharing this workout.
Please find my approach below:
I have revised the “Number of Days” calculation to incorporate a logical condition, ensuring that the Start Date is not greater than the End Date: =IF($J$1<=$J$3, $J$3-$J$1+1, “Start Date Cannot be greater than End Date”)
Formula for calculation total Quantity based on dynamic range selection: =IFERROR(SUM(OFFSET($A$2,MATCH($J$1,Dates,0)-1,2,$M$3,1)),“Check the Start and End Date”)