{"id":1790,"date":"2022-09-19T10:18:32","date_gmt":"2022-09-19T15:18:32","guid":{"rendered":"http:\/\/xlfxs.com\/?p=1790"},"modified":"2022-09-19T10:18:32","modified_gmt":"2022-09-19T15:18:32","slug":"repeated-offset","status":"publish","type":"post","link":"https:\/\/xlfxs.com\/?p=1790","title":{"rendered":"Repeated Offset"},"content":{"rendered":"\n<p>I needed to have an offset of columns to be repeated every 12 months.<\/p>\n\n\n\n<p>This is part of a project, we needed to calculate the coefficient of sales prediction based on the month number, we do have coefficient saved in another table that repeated every year (12 months).<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>So we needed a formula to calculate the offset to multiply times coefficient to find the sales predictions.<\/p>\n\n\n\n<p>I extracted a formula that allows me to reuse when I need a repeated offset to be calculated.<\/p>\n\n\n\n<p><code>=C3-(INT((C3-1)\/ $F$3)*$F$3)<\/code><\/p>\n\n\n\n<p>The example here is for this pure offset repeater formula, once you change &#8220;Repeat offset every&#8221; in cell F3, you can see formulas in column D getting updated to reach that repeating pattern that we need.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><a href=\"http:\/\/xlfxs.com\/wp-content\/uploads\/2022\/09\/repearoffset1.png\"><img decoding=\"async\" src=\"http:\/\/xlfxs.com\/wp-content\/uploads\/2022\/09\/repearoffset1.png\" alt=\"\" class=\"wp-image-1791\"\/><\/a><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>This is the big formula in case interested (in R1C1 syntax)<\/p>\n\n\n\n<p>The coefficient area starts in Column BS (R1C70) in sheet called D, while sales is in RC24 or RC25, RC26 has month number 1 through 12, RC29 has the row number needed from D sheet.<\/p>\n\n\n\n<p><code>=IfError(If( RC25=0, RC24, RC25 ) * Offset( 'D'!R1C70, RC29 - 1, RC26 + Column() - 30 -(INT((RC26 + Column() - 30 -1)\/12)*12) ), 0) <\/code><\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/1drv.ms\/x\/s!An4iomsT7EVO65dLqPJAwWDnZGDZGQ?e=WbnyWg\" style=\"border-radius:4px\">Excel Online<\/a><\/div>\n\n\n\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"http:\/\/xlfxs.com\/wp-content\/uploads\/2022\/09\/RepeatedOffset.xlsx\" style=\"border-radius:4px\">Download Excel<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I needed to have an offset of columns to be repeated every 12 months. This is part of a project, we needed to calculate the coefficient of sales prediction based on the month number, we do have coefficient saved in another table that repeated every year (12 months).<\/p>\n","protected":false},"author":1,"featured_media":1793,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,72,3,81,86,35,36,38,47,6],"tags":[110,147,151,173],"class_list":["post-1790","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-basic-math","category-column","category-formulas","category-iferror","category-int","category-logical","category-lookup_and_references","category-math-and-trig","category-offset","category-standard_functions","tag-column","tag-if","tag-int","tag-offset"],"_links":{"self":[{"href":"https:\/\/xlfxs.com\/index.php?rest_route=\/wp\/v2\/posts\/1790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlfxs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlfxs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlfxs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlfxs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1790"}],"version-history":[{"count":0,"href":"https:\/\/xlfxs.com\/index.php?rest_route=\/wp\/v2\/posts\/1790\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xlfxs.com\/index.php?rest_route=\/wp\/v2\/media\/1793"}],"wp:attachment":[{"href":"https:\/\/xlfxs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlfxs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlfxs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}