+ Reply to Thread
Results 1 to 10 of 10

Mirror a cell while adding to numbers

  1. #1
    Registered User
    Join Date
    03-19-2014
    Location
    United States
    MS-Off Ver
    Excel 2011 mac
    Posts
    12

    Mirror a cell while adding to numbers

    Hey everyone, I've looked at a lot of posts that come close, but I believe the steps I need are compound.

    In cell A1 I have the following text, numbers and a line break:

    Instruction: 100

    Review: 34

    I would like to mirror this data in B1, while adding a number(we'll use 10 for example) to each number in A1, resulting in:

    Instruction: 110

    Review: 44

    It's ok for the line break to be lost but I'd prefer to keep it in the results.

    Any ideas?

    Thanks,
    Matt

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Mirror a cell while adding to numbers

    Is there a condition as to the numbers that will be present?

    For example, the numbers will not be greater than 100 or less that 0?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    03-19-2014
    Location
    United States
    MS-Off Ver
    Excel 2011 mac
    Posts
    12

    Re: Mirror a cell while adding to numbers

    The numbers will never be less than 0 or greater than 1000.

  4. #4
    Registered User
    Join Date
    03-19-2014
    Location
    United States
    MS-Off Ver
    Excel 2011 mac
    Posts
    12

    Re: Mirror a cell while adding to numbers

    Additionally, the final values can omit the text and past just the numbers, if easier.

    Example result for B1:
    110
    44

    Thanks!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Mirror a cell while adding to numbers

    Try this...

    Data Range
    A
    B
    1
    Instruction: 100
    Review: 34
    Instruction: 110
    Review: 44


    This formula entered in B1:

    ="Instruction: "&LOOKUP(1001,--MID(A1,13,{1,2,3,4,5}))+10&CHAR(10)
    &"Review: "&LOOKUP(1001,--RIGHT(A1,{1,2,3,4,5}))+10

    Format to wrap text.
    Last edited by Tony Valko; 03-19-2014 at 03:49 PM. Reason: replaced ; with ,

  6. #6
    Registered User
    Join Date
    03-19-2014
    Location
    United States
    MS-Off Ver
    Excel 2011 mac
    Posts
    12

    Re: Mirror a cell while adding to numbers

    That works! However, the text varies at times from Instruction, to Assessment, to Review, etc.

    Is there a way to omit the text from the results?

    Thanks,
    Matt

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Mirror a cell while adding to numbers

    Mine is much more complex than Tony's. See the Defined names to get "Firstdigits" and SecondDigits"

    Then
    =REPLACE(REPLACE(A1, MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")), firstdigits, MID(A1, MIN(SEARCH({0,1,2,3,4,5,6,7,8,9}, A1&"0123456789")), firstdigits)+10),MIN(SEARCH({0,1,2,3,4,5,6,7,8,9}, A1&"0123456789",FIND(CHAR(10),A1))), SecondDigits, MID(A1, MIN(SEARCH({0,1,2,3,4,5,6,7,8,9}, A1&"0123456789",FIND(CHAR(10),A1))),SecondDigits)+10)
    See attachment
    Sure it's worth it?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Mirror a cell while adding to numbers

    For just the numbers:

    =LOOKUP(1001,--MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&1234567890)),ROW(INDIRECT("1:"&LEN(A1)))))+10&CHAR(10)&LOOKUP(1001,--RIGHT(A1,{1,2,3,4,5}))+10

  9. #9
    Registered User
    Join Date
    03-19-2014
    Location
    United States
    MS-Off Ver
    Excel 2011 mac
    Posts
    12

    Re: Mirror a cell while adding to numbers

    Tony,

    Your last post is working perfectly with 1 exception. I'm not getting a line break inserted between my results. Is there a way we can do that? Wrap text is selected. If not, you've still greatly helped me!

    ChemistB,

    When I open your excel file I get #VALUE! as a result. Keep in mind, I'm on a mac using Excel 2011 V 14.3.8 I imagine this might be the problem.

    Thanks!,
    Matt

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Mirror a cell while adding to numbers

    Works OK for me.

    The formula will return 11044 and after you format to wrap text you should get the result as displayed below:

    Data Range
    A
    B
    1
    Instruction: 100
    Review: 34
    110
    44


    You might have to adjust the column width to get the correct display.

+ 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] Adding numbers in the same cell
    By JimLau in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-27-2012, 11:10 PM
  2. Adding up numbers that are in one cell
    By Shoubakka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2011, 04:51 AM
  3. adding numbers in a single cell as a running total in that cell ?
    By jlg371 in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 02-01-2009, 08:40 PM
  4. Replies: 4
    Last Post: 11-16-2008, 05:48 PM
  5. Adding numbers in one cell and showing total in seperate cell
    By Deernad Construction in forum Excel General
    Replies: 12
    Last Post: 11-29-2005, 03:35 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