How can I code this in excel better?

I need to produce a set of numbers like:

(A,A+5,A+10,A+15,A+1,A+6,A+11,A+2,A+7,A+12, etc.)

It is not in sequence but more like a combination of sequences. Can it be done with less code?


I forgot to add that the numbers must be produced by a macro. I'm not sure how it is written though.

1 Answer

  • 6 months ago
    Favorite Answer

    YOur formula is missing a Function. Can you describe your excel sheet and perhaps we can get closer to what you may need.

    Update to add:

    What I mean is, what cells have what information and how does it all pertain to eachother? For example, the first A in your sample above refers to a column, not any particular cell. Being in parenthesis means it's some sort of excel formula, but has no function. As an example =SUM(a1+B1) would give you the total of adding the number in cell A1 to the number in cell B1. So, more info would help....

    Edit to add

    You don't need a macro, you can do this with a function RANDBETWEEN Read more here

    As an example, you would put the FORMULA

    =RANDBETWEEN(lowest,highest) in cell A1

    then each of the cells across the row would do your math for you.

    B1 would be =A1+5

    C1 would be =A1+10

    D1 would be =A1+15


    does this do what you needed?

Still have questions? Get your answers by asking now.