January | February | March | Q1 | April | May | June | Q2 | July | August | September | Q3 | October | November | December | Q4 | YTD | |
2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | 2020 | |
Apples | 10 | 10 | 10 | 30 | 10 | 10 | 10 | 30 | 10 | 10 | 10 | 30 | 10 | 10 | 10 | 30 | 50 |
Hey everyone. I'm trying to figure out a formula for the Q1-Q4 Columns that will dynamically sum based on the current date and quarter so that I have a correct YTD sum at the end.
Right now my YTD formula is SUM(B4:INDEX(B4:Q4,MATCH("current month",$B$1:$Q$1,0))). Originally I did not have quarter columns so this formula worked great for me because it would automatically update the YTD based on the month.
However now that I have these quarter columns I am getting a YTD sum that is double counting the quarter columns.
Example: It is currently May so YTD Apple sales should be 50. Instead however my YTD formula returns 80 which is 50 + 30 from Q1 column.
My attempt at fixing it: SUM(B4:INDEX(B4:Q4,MATCH("current month",$B$1:$Q$1,0)))-Sum(E4,I4,M4,Q4). However now I get 80 - 120 = -40 which is also incorrect. The Idea I am trying to figure out now is if there is a way to set Q1, Q2, Q3, and Q4 as dynamic sums that will only add up if the dates match. Example: Q2 will be 10 in April, 20 in May, and then 30 in June. Q3 will be 0 in June, 10 in July, 20 in August etc.
Sorry I hope this is clear, let me know if I need to explain further. I am not married to my current idea for a solution so if you have alternative, easier implementations that would work for me as well.
Thank you for your help.