OzGrid

How to drag every Nth Column, with varying starting column by Date

< Back to Search results

 Category: [Excel]  Demo Available 

How to drag every Nth Column, with varying starting column by Date

 

Requirement:

 

The goal is to use a formula similar to: =OFFSET($C$5,0,(COLUMN(A8)*3)-1) and drag a result (in this case "$2,500) from the starting cell, and every five years thereafter.

 

Solution:

 

=IF($E$6>I$5,0,CHAR(CODE(IF(MOD(YEARFRAC($E6,I$5),$H$12)=0,$G$11,0))+IF($E$6>I$5,0,IF(MOD(YEARFRAC($E6,I$5),$H$12)=0,YEARFRAC($E6,I$5)))))

 

Obtained from the OzGrid Help Forum.

Solution provided by Nymerc.

 

See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets

 

See also:

How to use a VBA code to change cells colours based on date in other cells
How to count non blanks 5 years from the last non blank date
How to use SUMPRODUCT with dates
How to sum up values in a date range

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.

 

 


Gallery



stars (0 Reviews)