+ Reply to Thread
Results 1 to 15 of 15

Formula to Increment Alphanumeric from negative to positive in "X" row sets

  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Unhappy Formula to Increment Alphanumeric from negative to positive in "X" row sets

    Hi All! I have a value "Y-9." that I need to incrementally increase by "2." up to a value of say "Y9." (I will do the same with an "X-20." to "X20." and I assume the same formulation would work for both)
    I also need this increase to stay the same for approx. 10 rows.
    Below is my Sample/TEST. The problem is "LEFT(A1,1)&TEXT(RIGHT(A1,3)+2,"0."" looks for the three right most digits. being "-9."........... When the value increases to a POSITIVE, it drops the "-" (NEGATIVE) and is now a positive "y9." This then fouls up my code, leaving me wanting more, and giving the #VALUE! .........…
    Between my two columns, of X-20. to X20. and Y-9. to Y9. I have 220 ish COMBOS.

    On a side note, every time y goes from Y-9. thru the range to Y9. I need X to increase by 2. …….. Which I can do with the code below if I figure it out. AND Also, I need Z to decrease by .15 every row. up to Z-1.5 ……… This I am pretty ok with copying and pasting, unless someone feels crafty.

    This is my SAMPLE for the "Y" Column - using the following code:
    =IF(COUNTIF($B$1:B1,B1)=3,LEFT(B1,1)&TEXT(RIGHT(B1,3)+2,"0."),B1)

    B1 being y-9.

    X-20. Y-9. Z-.15
    X-20. Y-9. Z-.30
    X-20. Y-9. Z-.45
    X-20. Y-9. Z-.60
    X-20. Y-9. Z-.75
    X-20. Y-9. Z-.90
    X-20. Y-9. Z-1.05
    X-20. Y-9. Z-1.20
    X-20. Y-9. Z-1.35
    X-20. Y-9. Z-1.50
    X-20. Y-7. Z-.15
    X-20. Y-7. Z-.30
    X-20. Y-7. Z-.45
    X-20. Y-7. Z-.60
    X-20. Y-7. Z-.75
    X-20. Y-7. Z-.90
    X-20. Y-7. Z-1.05
    X-20. Y-7. Z-1.20
    X-20. Y-7. Z-1.35
    X-20. Y-7. Z-1.50
    SKIPPING ROWS SKIPPING ROWS
    X-20. Y9. Z-.15
    X-20. Y9. Z-.30
    X-20. Y9. Z-.45
    X-20. Y9. Z-.60
    X-20. Y9. Z-.75
    X-20. Y9. Z-.90
    X-20. Y9. Z-1.05
    X-20. Y9. Z-1.20
    X-20. Y9. Z-1.35
    X-20. Y9. Z-1.50
    X-18. Y-9. Z-.15
    X-18. Y-9. Z-.30
    X-18. Y-9. Z-.45
    X-18. Y-9. Z-.60
    X-18. Y-9. Z-.75
    X-18. Y-9. Z-.90
    X-18. Y-9. Z-1.05
    X-18. Y-9. Z-1.20
    X-18. Y-9. Z-1.35
    X-18. Y-9. Z-1.50
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: **NEED HELP!**Formula to Increment Alphanumeric from negative to positive in "X" row s

    To get the numeric value, try using MID()...
    F
    G
    H
    I
    J
    K
    1
    X-20. Y-9. Z-.15
    -20
    -9
    -0.15
    2
    X-20. Y-9. Z-.30
    -20
    -9
    -0.3
    3
    X-20. Y-9. Z-.45
    -20
    -9
    -0.45
    4
    X-20. Y-1. Z-1.35
    -20
    -1
    -1.35
    5
    X-20. Y-1. Z-1.50
    -20
    -1
    -1.5
    6
    X-20. Y1. Z-.15
    -20
    1
    -0.15
    7
    X-20. Y1. Z-.30
    -20
    1
    -0.3


    I1=--MID(F1,2,99)
    copied down

    Now that you have the numeric isolated, you should be able to do the calcs you want?

    What triggers the increase of X-20 to X-18 etc?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Re: **NEED HELP!**Formula to Increment Alphanumeric from negative to positive in "X" row s

    Thanks for the quick response, although I'm not after the Isolated numbers as much as I am the compiled list.
    Short story, CNC PROGRAMMING, trying to write a Peck Tapping cycle and I need the compiled LIST of X, Y, Z coordinates to copy and input in my "G-Code". The "STARTING POSITION" is (negative) X-20. Y-9. Z-.15 the ending position would be (positive) X20. Y9. Z-1.5
    note that the XandY increment by 2. which is 2". These are my hole spacings! but there's 220 holes roughly, and 10depths of cut for each hole in .15" increments hence the z-.15 z-.30 etc..... you can see my delimma!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    I understand you wanted more than just the numeric, but I thought if I showed you how to do that, you could then build it into your formula to do what you needed. My understanding was you were struggling to isolate the numeric when it changed sign?

  5. #5
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    Ok, Makes sense, I feel as tho I could generate the numbers I need with that method, However I'm no pro, and I am not sure what "I1=--MID(F1,2,99)" is, could you explain briefly? I guess you could just as easily as I could google.... I would then need to add back the X for X values and Y for Y values...


    EDIT, I think im catching on. but please explain if you get a chance!

  6. #6
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    Maybe what Im not clear on is I am Creating this table. I do not have the table, I am making it. if that makes a difference. I like the idea of MID, just not seeing how it would apply, I would be trying to take my RAW DATA -20. -9. -.15 and turning it INTO x-20. y-9. z-.15 MID sounds like it would work great if I HAD the X Y Z list and was trying to extract the RAW NUMBERS. Am I missing something? It feels like Monday! HAHA! Thanks for looking at this FDibbins!
    Last edited by Mj_McKenzie; 06-06-2018 at 04:22 PM.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    any time you use LEFT/MID/RIGHT, you get a text answer. If the result is a number (that will still text) you can force that to be numeric by using -- (double unary operator)
    see here for a better explanation that I could give
    https://stackoverflow.com/questions/...-does-in-excel

    The way Im extracting the "numeric"...
    =mid(F1, 2, 99)
    =mid(cell, starting from position 2, take the next 99 places)
    I used 99 because noway would you ever exceed that amount of characters. If it makes more sense to you, you could use 3, instead, seeing as how say you wont exceed -20

  8. #8
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    Oh, ok, I am starting to see! I think I understand. I am stepping out for a bit, I will get after it later! I will respond either later today or tomorrow. thanks so much for your help!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    Using my table from post 2 above, this will decrease your Y value by .15...
    G2=LEFT(G1,1)&MID(G1,2,99)+INT((ROWS($1:2)-1)/10)*2&"."
    copied down

    Im working on the Z value

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    This will do the Z value...
    =LEFT(H1,1)&MID(H1,2,99)-IF(G2=G1,0.15,-1.35)

    But I just noticed the Y formula isnt working properly, I will fix it

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    OK, again, based on table in #2, use this for the Y value...
    G2=LEFT(G1,1)&MID(G1,2,99)+IF(ISERROR(1/MOD((ROWS($1:2)-1),10)),2,0)&"."
    copied down

  12. #12
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    Thanks FDibbins, If I manually enter Y Values in "G" The Z Formula works up until the Y value changes. Then the Z jumps. Id post pics, but Im not sure if the uploads are working. And when I place the Y code in the G2 slot, it just says the code. It doesn't formulate a number.
    Attached Images Attached Images

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    In the attached file, my 2 formulas (for Y and Z) seem to be working OK? I even tested them against your sample answers.

    I also noticed that when you change X, Y and Z repeat themselves from the beginning again. This makes me think that after row 100 (200 etc), you could just start referencing row 1 , 2 etc, for Y and Z, instead of using those formulas
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    That looks like it! Thanks SO VERY MUCH! Man that was some fancy footwork.... That will be applicable in more than one instance for me. I don't come to Excel Forum often, but when I do you guys never disappoint! Thanks again! Happy Friday!

  15. #15
    Registered User
    Join Date
    07-13-2012
    Location
    san antonio tx
    MS-Off Ver
    2016
    Posts
    15

    Re: Formula to Increment Alphanumeric from negative to positive in "X" row sets

    How do I now mark this post as solved?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula to get negative to positive value and positive to zero
    By Nikunj Morjaria in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-18-2014, 08:27 AM
  2. [SOLVED] Formula to switch a positive value into a negative value
    By trosasco in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-21-2013, 12:10 PM
  3. Replies: 4
    Last Post: 01-09-2012, 07:34 PM
  4. Convert negative to positive in sheet containing both positive/negative numbers
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2010, 07:52 PM
  5. Replies: 1
    Last Post: 08-14-2009, 11:17 AM
  6. Replies: 2
    Last Post: 11-13-2008, 12:35 AM
  7. Replies: 4
    Last Post: 09-26-2005, 06:05 PM

Tags for this Thread

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