+ Reply to Thread
Results 1 to 7 of 7

Value differences between cells

  1. #1
    Registered User
    Join Date
    02-15-2011
    Location
    Ede, Netherlands
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    9

    Lightbulb Value differences between cells

    Hello,
    In this sheet i have a sequence of integers, they go from 1 to 100
    I want to calculate the differences between the integers and add them up.
    For example, this sequence:

    20 55 79 10

    Between the first two 20 and 55 the difference is 35
    55 and 79 is 24
    79 and 10 is 69

    Now we have these numbers and i want to add them up so:

    35 + 24 + 69 = 128

    In the end the row will look like this:

    20 55 79 10 128

    The lenght of the sequences varies and there are also empty gaps in the sequence sometimes

    This list exist of over 200.000 rows so i need to automate this process

    I have no experience in excel at all, but i do have programming experience

    Thank you in advance

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Value differences between cells

    If using 2008 as implied you have no VBA support so you will have to do this with formulae.

    It's not clear which columns contain the values but if we assume you insert a column such that Col A is blank then:

    Please Login or Register  to view this content.
    modify ranges as nec. - the above assumes each precedent cell contains either a number / numeric string
    (text values etc would generate #VALUE! errors)

    post back with a small sample file if nec.

    edit: scrap all of the above (apart from VBA of course) given:

    Quote Originally Posted by iMellroy
    The lenght of the sequences varies and there are also empty gaps in the sequence sometimes
    my bad - I didn't read thoroughly
    Last edited by DonkeyOte; 02-15-2011 at 06:48 AM.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Value differences between cells

    I think the below would work but I am also convinced there are far better methods...

    Please Login or Register  to view this content.
    again this uses column A to store results where values in B:Z etc... modify as nec.

    I've uploaded a sample for sake of auto translation / delimiters etc... and have assumed XL2008
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-15-2011
    Location
    Ede, Netherlands
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    9

    Re: Value differences between cells

    Sorry for my abcense on this topic.
    Thank you for your help, but i still cant figure it out.
    So i included a sample file of the data i'm working with in the attachment

    The columns that i want to process are from AI to DF
    the outcome of the all the differences between the numbers could be in column DG
    Also, how can I execute a formula instead of inserting text in the cell, CTRL + SHIFT + ENTER as mentioned above? I tried it but didn't do it...
    As i said, i really have no experience at all in xl bu i do have experience in programming language.

    Again, thank you for your help
    Attached Files Attached Files

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Value differences between cells

    Formula wise - adapting prior example per ranges in your sample:

    Please Login or Register  to view this content.
    Attached is your sample with above formula in place.
    The formula should translate per your locale config. when opened.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-15-2011
    Location
    Ede, Netherlands
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    9

    Re: Value differences between cells

    Thank you very much. You've saved me a lot of time, I now can spend on visualising the data

  7. #7
    Registered User
    Join Date
    02-15-2011
    Location
    Ede, Netherlands
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    9

    Lightbulb Re: Value differences between cells

    just another question, i dont know how to copy the formula to the other cells
    when i copy the code from the example file to my complete file, it always returns zero
    (see attachment)

    and how do i copy the code down to the cells below, once i have it in the first cell?

    btw here you can download the complete file, it is too big to add in the attachment but i was exaggerating about the 200.000 rows
    there are around 35.000 or some
    bullfrogspond.com/charts.rar

    thank you in advance

    EDIT: oke i confirmed with CTRL SHIFT ENTER i guess did the trick
    i think i got it now
    Attached Images Attached Images
    Last edited by iMellroy; 03-01-2011 at 08:11 AM.

+ 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