Increment a Number A1 by Increment B1

ionelz

Active Member
Joined
Jan 14, 2018
Messages
259
Office Version
  1. 365
Platform
  1. Windows
Hi,
A1=23.2
B1=5

Result should be :
0
5
10
15
20
23.2
Thanks for help
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi, you could try like this maybe..

Book1
ABC
123.20
255
310
415
520
623.2
Sheet1
Cell Formulas
RangeFormula
C1:C6C1=LET(s,SEQUENCE(ROUNDUP(A1/A2,0)+1,,0,A2),IF(s>A1,A1,s))
Dynamic array formulas.
 
Upvote 0
Try:
Book1
ABC
123.240
24
38
412
516
620
723.2
Sheet3
Cell Formulas
RangeFormula
C1:C7C1=UNIQUE(VSTACK(SEQUENCE(FLOOR.MATH(A1,B1)/B1+1,,0,B1),A1))
Dynamic array formulas.
 
Upvote 0
Book1
ABC
123.240
244
38
412
516
620
723.2
Sheet1
Cell Formulas
RangeFormula
B1B1=A2
C1:C7C1=LET(s,SEQUENCE(ROUNDUP(A1/A2,0)+1,,0,A2),IF(s-A1>0,A1,s))
Dynamic array formulas.
 
Upvote 0
If I change B1=4, it doesn't work
What result do you expect when A2 B1=4?

Book1
ABC
123.240
24
38
412
516
620
723.2
Sheet1
Cell Formulas
RangeFormula
C1:C7C1=LET(s,SEQUENCE(ROUNDUP(A1/B1,0)+1,,0,B1),IF(s>A1,A1,s))
Dynamic array formulas.
 
Upvote 0
I got in trouble with formulas.
All good but if A1 is Prime number then I get only 2 values, 0 and itself
So I want to keep formulas above BUT if A1 is Prime number then B1=2
So like if A1 is 11, results would be
0
2
4
6
8
10
1
 
Upvote 0
I'm not following any of that really! Maybe the others will, or perhaps you can have another go at explaining it or give a few more examples of different inputs and their expected outputs.
 
Upvote 0
I agree. That new pattern doesn't match your original post. Why did your pattern end in 1, and not 11?
What does a prime number have to do with anything?
The only way that I would see that you would get 0 and the number in A1 is if was equal to the number in B1.
A1:5
B1:5

but this has nothing to do with prime numbers only that they are equal.
 
Upvote 0

Forum statistics

Threads
1,224,862
Messages
6,181,465
Members
453,045
Latest member
Abraxas_X

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