Forum Discussion
finding the year in a range of cells
Hello everybody,
I'm trying to find a way that I can work out the year for every cell in a column, without having to individually type "YEAR (a1), Year (a2)….etc". The column could hold 65000 cells eg. a1-a65000.
each cell in the range will have a different date and year. on each Row there is also a dollar value associated with that month and year. Just to make things harder, the dates on each row will not necessarily be in order.
I need to make a table that finds the year and the dollar value and the month. Each row in the table is for another year eg 2019, 2020, 2021 etc. and each column in the table is for the month. All dollar values for that year, in that month needs to added together, to give a final total of sales for that month and year.
I am absolutely hopeless with VBA, and only just above a novice in excel use. Any help anyone could give me would be really helpful and appreciated
Jeff
Hi Jeff,
Few variants
- you may pivot your source by year and month added in data model;
- you may use formula as SUMPRODUCT
- you may use Power Query
perhaps something else
Sample is attached.
4 Replies
- SergeiBaklanDiamond Contributor
Hi Jeff,
Few variants
- you may pivot your source by year and month added in data model;
- you may use formula as SUMPRODUCT
- you may use Power Query
perhaps something else
Sample is attached.
- JreggyCopper Contributor
Hello Sergei,
That is exactly what I am looking for. Thank you so much, I have been struggling with this for months, and in one night you showed me a nice simple way of doing this.
Thank you
Regards
Jeff
- SergeiBaklanDiamond Contributor
Jeff, glad to help