Add incremental value every x columns

bcollard118

New Member
Joined
Aug 5, 2019
Messages
2
This feels elementary, but I figure this is the best place to ask. My starting value is 1000 and I would like to add 500 every x columns (dynamic based on cell input). Can someone help me write the formula for this request?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Re: Need to add incremental value every x columns

Hi, welcome to the board.

Let's make some assumptions.
1) Your starting value of 1,000 is held in cell A2.
2) You want to populate the remainder of row 2, i.e. cells B2, C2, and so on.
3) The cell input to determine "...every x columns..." is held in cell A1.
4) For any entry where you are NOT adding an extra 500, you want to simply repeat whatever the previous value was.
5) The value of 500 is stored in cell C1.

Put this in B2 and copy across row 2 as far as required.

Code:
=A2+(MOD(COLUMN()-1,$A1)=0)*$B1
 
Upvote 0
Re: Need to add incremental value every x columns

Thank you for the quick response, Gerald. What if the date range that I am following does begin in column A. Rather I have the following:
Starting value cell C5 (1000)
Incremental value cell C6 (500)
Cell Input "every x columns" C7 (3)

If my first cell (F16) I would like to see 1000, G16 equals 1000, H16 equals 1000, then I16 equals 1500. Does that make sense?
 
Upvote 0
Re: Need to add incremental value every x columns

Then just adapt my proposal to reflect your real position.

Something like this
Code:
=C5+(MOD(COLUMN()-3,$C7)=0)*$C6
 
Upvote 0
Re: Need to add incremental value every x columns

Hi Gerald,

I tried your formula and it returned 1500 / 0 / 0 / 500 (F16:I16) for me - with C5 = 1000, C6 = 500, C7 = 3.

I have re-jigged the formula and come up with this:

Set F16 (start) = C5

G16:
Code:
$C$5+IF(MOD(COLUMNS($F$16:G16)-1,$C$7)=0,((COLUMNS($F$16:G16)-1)/$C$7)*$C$6,F16-$C$5)

Not sure if your formula is pulling correctly Gerald? I was curious by this question hence the inquisitiveness :nya:
 
Last edited:
Upvote 0
Re: Need to add incremental value every x columns

I guess I should have been more explicit about where exactly my formula should have been located - I was putting it in D5, and copying it across to E5...F5...G5... and so on.

For me, this works fine.

Your solution clearly works as well.
It has the advantage that your use of the COLUMNS function does away with having to have the columns hard coded into the formula, which is what mine does.
But your's seems a bit more complicated than it needs to be.
You can simplify to this
Code:
=F$16+(MOD(COLUMNS($F$16:G16)-1,$C$7)=0)*((COLUMNS($F$16:G16)-1)/$C$7)*$C$6
 
Upvote 0
Re: Need to add incremental value every x columns

Ahh that makes sense now, thanks Gerald!

I have just tried the amended formula you have wrote, starting with G16 and going out to O16 and the increments from C6 turn strange, it first goes to 1500 (I16), then 2500 (L16) and finally 4000 (O16)

It looks as if it adds on N multiples of the 500 every N columns, instead of adding on 1 lot of 500 every N columns?
 
Upvote 0
Re: Need to add incremental value every x columns

You're right, my amended version was wrong, I hadn't tested it properly, sorry !

The correct version is even simpler . . .
Code:
=F$16+(MOD(COLUMNS($F$16:G16)-1,$C$7)=0)*$C$6
 
Upvote 0
Re: Need to add incremental value every x columns

That's brilliant! Knew that there would be a more efficient formula :-)

Thanks Gerald, have a good one.
 
Upvote 0

Forum statistics

Threads
1,224,748
Messages
6,180,721
Members
452,995
Latest member
isldboy

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