If condition is met then 1 for n number of times in a loop

Brix23

New Member
Joined
Nov 15, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Dear all,

I am trying to create a formula which has two parts:
- the first part of the formula which I have managed to do =IF(MOD((IF(COLUMN(Q218)>=$A219;COLUMN(Q218);0))-1;$C218)=0;1;0), so after a certain date/column insert 1 and do this every n number of periods/columns
- now what I would like to add in a row bellow is the following, if condition is meet, namely if in the above row I have 1 (from the above equation) then have 0 for y number of periods. So for instance in the example bellow , if I have 1 in the row 2018 then I want in the row bellow 0 for n number of times which in this case is 3 (but this can change as well). Also, an important thing to mention is that this will not only happen once but several times. If

1672735211315.png


If someone is able to help me I would be truly appreciative. The only thing I can think about is nested if functions, but I hope there is a better way.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
if I have 1 in the row 2018 then I want in the row bellow 0 for n number of times which in this case is 3
Not exactly sure what you meant by the above. Can you post your excel using XL2BB for better visualization. From the image posted so not see anywhere “2018” could you please clarify
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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