+ Reply to Thread
Results 1 to 12 of 12

formula >0

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-09-2006
    Posts
    212
    I got the ABS to work, sweet. Thanks much. If I have a row of numbers like the following:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Is there a way I can get Exl to highlight the numbers in the row that could be ancored at say 3, then add 2. It would highlight 5, then add 2 highlight 7 add 2 highlight 9 etc.
    or if I start the sequence at 4 and add 6 it would highlight 10, then 16 then 22 then 28 then 34 etc.
    Is this possible?

    Kindest regards,
    Martin.

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Martindelica
    I got the ABS to work, sweet. Thanks much. If I have a row of numbers like the following:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Is there a way I can get Exl to highlight the numbers in the row that could be ancored at say 3, then add 2. It would highlight 5, then add 2 highlight 7 add 2 highlight 9 etc.
    or if I start the sequence at 4 and add 6 it would highlight 10, then 16 then 22 then 28 then 34 etc.
    Is this possible?

    Kindest regards,
    Martin.
    Hi,

    select the column, Format, Conditional Format,
    formula is
    =IF(MOD((A1-4)/6,1)=0,TRUE)
    set the Pattern required.

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Contributor
    Join Date
    10-09-2006
    Posts
    212
    Hi Bryan thanks, as usual worked like a charm. If I have a col of the following numbers:
    23
    25
    26
    28
    29
    34
    32
    30
    29
    26
    23
    22
    The value goes up and down, is there a way to have excel list the numbers all going up? I dont mean sort. I mean result in the following;
    23,25,26,28,29,34,36,38,39,43,46,47.
    It would take the last number of the up slope and add the difference and so on. ie, 34-32=2, so it would be 34+2=36 then 32-30=2 add this to the 36=38...Exl would have to know when the number direction changes to go down and add the down numbers to the up going numbers to continue the sequence.

    Warmest regards,
    Martin.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    In A2 enter = A1

    Then in B2 enterthe below and drag down

    =B1+ABS(A2-A1)

    You will find the last 3 are different as you added 4 not 3

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Forum Contributor
    Join Date
    10-09-2006
    Posts
    212
    This still gives me the values going up and then they go back down. I need them to contiue the pattern but going up.
    23,24,25,26,27,28,27,26,25,24,23, Should the following
    23,24,25,26,27,28,29,30,31,32,33,
    or
    15,17,19,22,36,48,39,37,29,28, Should be the following;
    15,17,19,22,36,48,57,59,65,66,

    Kindest regards,
    Martin.

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    This still gives me the values going up and then they go back down. I need them to contiue the pattern but going up.
    23,24,25,26,27,28,27,26,25,24,23, Should the following
    23,24,25,26,27,28,29,30,31,32,33,
    or
    15,17,19,22,36,48,39,37,29,28, Should be the following;
    15,17,19,22,36,48,57,59,65,66,
    Martin, I just used VBANoob's formula and it worked perfectly. Are you sure you typed it correctly, or copy/pasted it in the right spot?

    If your column of #'s are in A1:A10, in B1 put the formula, =A1
    Then, in B2, put his formula, =B1+ABS(A2-A1)
    Fill that formula down to B10. It should give you the correct results.

    As Noob mentioned, the series you list in both of your last posts are not accurate.

    15, 17, 19, 22, 36, 48, 39, 37, 29, 28 should become
    15, 17, 19, 22, 36, 48, 57, 59, 67, 68 since there's a gap of 8 between 37 and 29, not a gap of 6

    23, 25, 26, 28, 29, 34, 32, 30, 29, 26, 23, 22 should become
    23, 25, 26, 28, 29, 34, 36, 38, 39, 42, 45, 46 since there's a gap of 3 between 29 and 26, not a gap of 4.

    Also check to see that automatic calculation is turned on in Tools-Options-Calculation.

  7. #7
    Forum Contributor
    Join Date
    10-09-2006
    Posts
    212

    Awesome

    This site truely is awesome!. Having stumbled across it on the net, I have shaved countless hours of my work due to those members that have provided me the right formulas. Thanks sooooo much guys.
    PS. Your absolutley right, the formula does work, I just typed in incorrectly. thanks again.

    Martin.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1