Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 07-10-2018, 09:54 AM
ArviLaanemets ArviLaanemets is offline Table with values from several locations and years - need to find comp values Windows 8 Table with values from several locations and years - need to find comp values Office 2016
Expert
 
Join Date: May 2017
Posts: 949
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

My version of comparison table is easily transformed for any setup. The logic of calculations is:
1. The pair of years to be compared are selected;
2. Years to be compared are calculated;
3. For both years, the January 1st, and its weekday number is calculated;
4. For both years, the date of 1st day of 1st week is calculated based in weekday of January 1st;
5. Following same logic as in p.3 and p.4. the dates of last day of last week are calculated (you calculate 1st day of week for next year and distract 1 from result).
6. All dates from 1st day of 1st week to last day of last week for both compared years are calculated. When date is bigger than last day of last week, an empty string is returned instead;
7. Calculate year/quarter/Month/week numbers for both columns. Easiest is with week numbers. You divide the value of (8 - datarange row number) with seven, and return integer part of result. 1st seven dates will get week number 1, next 7 dates week number 2, etc.. The year will be also simple - all dates in one date column belong to one year, all dates in another date column to another year. For quarter and month calculation, you must apply your own rules, like integer part of (14-week number) divided by 13 for quarter number (and when week number is bigger than 52, the quarter number will be 4). With months it is not so easy. The number of weeks may differ for different years (unless you left out some dates when this occurs). With ISO week numbers, a year has 52 or 53 weeks - with your system probably also. You reserve 8 weeks for 2 first months, and 5 weeks for last month. Remains 39 - 40 weeks for 9 months. Neither 39 nor 40 are not dividing exactly with 9 - the result is between 4 and 5. So you must have 4 months with 4 weeks, and additional 3 - 4 months with 5 weeks (the number depends on number of weeks in year) Or you use quarter numbers - when quarter has 13 weeks (a possible exception is 4th quarter), then in every quarter you must have at least one month with 5 weeks. This is most logical way, as a quarter is defined as 3-month period. I'm not even trying to imagine, how you'll compare two months, when one has 4 weeks, and another 5 weeks worth of dates (with my rules, this problem remains too - there is no way avoid this, except by leaving some dates out);
8. Anyway after that remains the last step - you calculate amounts and quantities for dates in compared years from your source table.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Table with values from several locations and years - need to find comp values Table with values from several locations and years - need to find comp values Ricardo Sousa Excel 6 06-09-2018 10:51 PM
code to find account and sum up values Brian13 Excel Programming 2 05-31-2017 09:26 AM
Find and replace multiple values, according to table value - excel formula EtanM Excel Programming 3 04-11-2016 01:43 AM
Display multiple values as new values based on selection from template. MvdB Excel 2 09-29-2015 08:51 PM
find 2 values i a table to find the right prise Vibov Excel 1 01-11-2015 07:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft