+ Reply to Thread
Results 1 to 7 of 7

Finding column number difference (not value difference)

  1. #1
    Registered User
    Join Date
    07-25-2019
    Location
    Austin, TX
    MS-Off Ver
    2010
    Posts
    4

    Finding column number difference (not value difference)

    Hi

    I would like to get the numeric value for the difference between two columns of a row. I am NOT interested in the difference of the values. I was wondering if there is a function(s) that I can use.

    For example, the difference between columns of A1 and C1 is 2. or A2 and E2 is 4.

    Thank you.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,711

    Re: Finding column number difference (not value difference)

    Yes. Try this:

    =COLUMN(E2)-COLUMN(A2)

    or this:

    =COLUMNS(A2:E2)-1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,508

    Re: Finding column number difference (not value difference)

    when you say you are not interested in the difference of value, then you mention that the difference between A1 and C1 is 2, isn't that a numeric difference or a value difference?
    A simple formula like =A1-C1 would return a numeric difference, and add ABS to it if you want the difference to always be a positive number like =ABS(A1-C1)
    But what makes the formula know that next it should look in A2 and E2 instead of A2 and C2 (if that was dragged down)?
    Are there other values in, say B1 or B2, C2 and D2 that should be ignored?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    07-25-2019
    Location
    Austin, TX
    MS-Off Ver
    2010
    Posts
    4

    Re: Finding column number difference (not value difference)

    Ali,

    You answered my question perfectly. Thank you.

  5. #5
    Registered User
    Join Date
    07-25-2019
    Location
    Austin, TX
    MS-Off Ver
    2010
    Posts
    4

    Re: Finding column number difference (not value difference)

    Sambo.

    Thanks for your reply. Ali's response was what I was looking for.

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,508

    Re: Finding column number difference (not value difference)

    Oh, duh, now I see what Pipan was looking for after thinking about what Ali gave you. So obviously post #3 has no relevance. Duh!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,711

    Re: Finding column number difference (not value difference)

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Macro for finding the Difference between two Timings of column and adjusting them
    By Haidar123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2014, 06:34 PM
  2. Replies: 3
    Last Post: 12-19-2013, 10:00 AM
  3. Replies: 8
    Last Post: 12-16-2013, 05:24 PM
  4. [SOLVED] Finding the most recent case in a column for time difference calculation
    By ahickey in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2013, 12:28 AM
  5. Replies: 9
    Last Post: 01-28-2009, 04:16 PM
  6. Replies: 0
    Last Post: 10-07-2008, 10:45 PM
  7. [SOLVED] charting a difference of 2 columns' w/o adding a difference column
    By Wab in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-26-2005, 10:05 PM

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