+ Reply to Thread
Results 1 to 6 of 6

Resolved >>> Subtracting from column letter

  1. #1
    Forum Contributor
    Join Date
    01-09-2006
    Posts
    109

    Resolved >>> Subtracting from column letter

    Is it possible to subtract a number from a column letter?
    I'm trying to create a sheet that does some helpful calculations. In order for me to finish it without a macro i need to be able to subtract a number in a cell from a column letter.
    Example F-5=A, The end i'm trying to achieve is to get a sum range to move left and right in this data set based on that number.

    Any ideas?

    Thanks All,

    Chris
    Last edited by VBA Noob; 10-22-2007 at 03:11 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Subtracting from column letter

    I suspect that if you describe what you ultimately want to do, we can come up with some good suggestions.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    01-09-2006
    Posts
    109
    I want to be able to move a sum range left and right based on this number.

    So like =SUM((F-5)7:(F-5)10), which would result in =SUM(A7:A10)

    So the range would go to the left 5 columns.

    That's the best example i can use to explain what i'm trying to get towards.

    Here's another.

    I want to be able to change the number of columns apart the numbers are that are subtracted from each other.
    =(F-5)1-(F-5)6

    Keeping in mind that the 5s i used would actually be a cell's value, so something like A1.

    Just yell at me if i'm making no sense.

    Thanks All,

    Chris
    Last edited by cbh35711; 10-22-2007 at 03:19 PM.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Subtracting from column letter

    Perhaps something like this:

    A1: (contains the offset value)

    B1: =SUM(OFFSET(F7:F10,,A1))

    That formula uses F7:F10 as the base range and offsets left (neg numbers in A1) or right (pos nums in A1) and sums the referenced range.

    Examples:
    A1: 2
    B1 sums H7:H10

    A1: -2
    B1 sums D7:D10

    Is that something you can work with?
    (See the OFFSET function in Excel Help)

  5. #5
    Forum Contributor
    Join Date
    01-09-2006
    Posts
    109

    Thumbs up

    Perfect!

    I knew vba had offset, i didn't realize you could use it in an excel worksheet.

    Thanks Ron,

    MVP, had to read what it meant, indeed

    Chris

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Subtracting from column letter

    Glad I could help (and thanks much for the kind words)

+ 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