+ Reply to Thread
Results 1 to 5 of 5

Add/subtract from number range in single cell

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Norway
    MS-Off Ver
    2013
    Posts
    12

    Add/subtract from number range in single cell

    Hello,

    I have a spreadsheet with a number of cells displaying various number ranges. For example, a cell might contain "33-38". Every now and then I need to reduce the range or increase it by a certain number, and both the lower and upper limits are increased/decreased the same amount. Due to the number of cells, this is quite cumbersome to do manually. Is there a way to format the range differently so that it allows for easy mass adding or subtracting? I know that I could split the range into separate cells, but this is not possible due to restrictions from the end user.

    Thanks!

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Add/subtract from number range in single cell

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Add/subtract from number range in single cell

    I know that I could split the range into separate cells, but this is not possible due to restrictions from the end user.
    I am not clear whether you want a formula solution (placed in another cell) in the ##-## format or if you want to format existing data in place.

    And yes ... as sandy says ... we could use an uploaded Excel file example.
    Dave

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Add/subtract from number range in single cell

    A third vote for a sample file.

    Excel will not see an entry like ##-## as a "range of numbers". It wills see it as a text string. So, in order to do any operation on the numbers, you will need to extract the number from the text string (and possibly change it from a text number to a number number), then perform the operation. Then, if needed, recombine it back into a text string.

    Using the specific example you gave, something like =CONCATENATE(LEFT("33-38",2)+5,"-",RIGHT("33-38",2)+5) would output "38-43". Note that I use the LEFT() and RIGHT() functions to extract the two numeric parts, then add 5, then recombine back into a text string. It seems that there are usually additional conditions and concerns that are not represented by a single example. Whatever specific solution is found, I expect it to contain those three steps.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: Add/subtract from number range in single cell

    Forth on the sample file,

    MrShorty probably has the solution. You could also split the "33-38" into columns, manipulate them as needed with formulae, and then CONCATENATE them back together with the all important "-". Or, if the change in the limits will be variable based on another cell entry, you can modify MrShorty's example to

    =CONCATENATE(LEFT("33-38",2)+$A$1,"-",RIGHT("33-38",2)+$B$1)

    Where $A$1 and $B$1 are absolute references to the variable you want to change the lower and upper limits by, respectively.

+ 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] How to subtract single cells with double digits into a single digit of a single cell.
    By greenfox74 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-11-2021, 02:05 AM
  2. [SOLVED] How do subtract time in single cell
    By silambarasan.J in forum Excel General
    Replies: 5
    Last Post: 04-15-2017, 02:33 PM
  3. [SOLVED] Basic function help, Subtract LEFT from RIGHT String in single cell :(
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2014, 11:51 AM
  4. Replies: 5
    Last Post: 07-07-2013, 03:39 PM
  5. Replies: 2
    Last Post: 03-16-2010, 01:01 PM
  6. Possible to ADD or SUBTRACT in single cell?
    By silliemillie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-10-2008, 04:31 PM
  7. Subtract a % from a single cell entry
    By David1932 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2008, 06:42 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