Mod function to repeat values

ddnron

Board Regular
Joined
Oct 11, 2003
Messages
115
Hi, Thanks for your assistance and time.

This formula works nice for my needs, of repeating a value.

=if(mod(column()-1,3)=0,$a$4,0) it displays my value every 3rd column, in row 4.


I have 365 columns with date in row 3, for each day of the year. E3 has Jan 1, 2018.

i want to put a date in cell b4 and then have this formula, start on that date in the correct/corespondent column, which has that date in row 3... then repeat every 3 columns.

Is it possible to tweak this to select an appropriate column, based off date in b4, then find that column, then start the value every three columns.


Thanks again for help
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hello ddnron,

This worked for me...

=IF(AND(COLUMN()>=MATCH($B$4,$E$3:$NE$3,0)+4,MOD(COLUMN()-1,3) = 0),$A$4,0)
 
Upvote 0
Hi Leith, Thanks for the quick reply. I used the date 1-12, and it worked fine, as well as 1-15, 1-18, etc. When I entered 1-9, then changed date to 1-8, or 1-7, it did not change the dates, it left it starting at 1-9. When I entered 1-6, it worked. I messed around with the +4 and -1 in the formula, but I could not get it to change correctly, when I changed the dates. any other suggestions would be appreciated. Thanks
 
Upvote 0
Hi Leith, Thanks for the quick reply. I used the date 1-12, and it worked fine, as well as 1-15, 1-18, etc. When I entered 1-9, then changed date to 1-8, or 1-7, it did not change the dates, it left it starting at 1-9. When I entered 1-6, it worked. I messed around with the +4 and -1 in the formula, but I could not get it to change correctly, when I changed the dates. any other suggestions would be appreciated. Thanks



Found solution, adjusted to work with my cells. Also used absolute cell reference for x,y,n.

=IF(AND(A1>=y,MOD(A1,n)=MOD(y,n)),x,"")
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top