Using =(if(mod(row) function

mmandym000k

New Member
Joined
Apr 5, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm building an Excel sheet that Adds 2 onto the previous cell every nth row as specified in cell $C$1. (It's for working out where to place increase stitches in a jumper sleeve!)

I cannot get the function to work for the first few rows; it excludes "Row 1" (actually row 5 on the spreadsheet) in the series.

The function I am using in "Row 2" is =IF(MOD(ROW(),$C$1)=0,C5+2,C5)


1649178601971.png


However, if I change it to make the calculation every 4 rows it doesn't work in the same way. Similarly if I change it to every 6 rows

1649178737293.png
1649179212254.png


I've tried all sorts of variations using =0 or =1. Or changing the cell reference for Row(). Can anybody help me please?
 

Attachments

  • 1649178560860.png
    1649178560860.png
    12.7 KB · Views: 4

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(MOD(ROWS(C$6:C6),$C$1)=0,C5+2,C5)
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(MOD(ROWS(C$6:C6),$C$1)=0,C5+2,C5)
Thanks for coming back so quickly; this worked if I entered either 4, 5 or 6 in $C$1 as per the examples I gave, but it wouldn't work for other numbers such as 2, or 3.
 
Upvote 0
Yes it does - Thank you! I think I'd spent so long working on this yesterday, I'd gone stir crazy with it.
Thanks for your help!
 
Upvote 0
Glad it's sorted & thanks for the feedback.
 
Upvote 0
Note: When selecting a post to mark as the "solution", you want to mark the post that actually contains the solution, by the person who provided the solution.
Please do not mark your own post that acknowledges that someone else posted the solution.
You would only mark your own post if your answered your own question and posted that solution to the thread.
I have updated it on this thread.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

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