# Values to increase until it hits the correct value

#### gazza_606

##### New Member
I currently have a column of numbers that raise in values of 1, i need these values to keep raising to a maximum value in another sheet. say for example

sheet "1" has a column that starts at 0 and goes to 1, 2, 3 but carries on going.
Sheet "2" has a value that is calculated in cell B3
I then need the column in sheet 1 to stop once it hits the value calculated in sheet 2 B3

I am trying to use the IF command but keep getting errors.

Can some help with this.
Thanks

### Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi,

an attempt: in sheet1 first number in A2

=MIN(ROW()-1,sheet2!B\$3)

to be copied down

Hope it helps

edit: sorry the corrections: I'm translating from my not English settings

Last edited:
Hi Canapone,

Thanks for this, i have changed it around slightly to =MIN((A30)+1,'Engine Data Sheet'!\$B\$39) - It was easier to call it sheet 1 & 2 for explaining . So this now works so thanks for that.

For a test i changed B39 to a value of 12 and it goes up to a maximum of 12 but then every value after that stays at 12. I only need it to go up to the very first 12 and then remove the other values after that, sorry i didnt add that into my first post.
Thanks

Hi,

Just for sharing other ideas, you have to adjust references.

=IF(ROW()-1>Sheet2!\$B\$3,"",MIN(ROW()-1,Sheet2!\$B\$3))

Regards

Thanks that works great now, just need to remove the #VALUE! which appears after the maximum value. I will try and find this out

Replies
3
Views
576
Replies
9
Views
465
Replies
1
Views
218
Replies
3
Views
177
Replies
5
Views
199

1,221,408
Messages
6,159,702
Members
451,586
Latest member
khaledshahin

### 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.

### Which adblocker are you using?

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

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