+ Reply to Thread
Results 1 to 10 of 10

Adding numbers in the same cell

Hybrid View

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Adding numbers in the same cell

    how can I take a number from one cell and add it to a number from another cell and keep the answer in the same cell

    THANKS RICHARD!
    Last edited by JimLau; 09-28-2012 at 02:00 AM.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Adding numbers in the same cell

    You are describing an accumulator. Say you enter 4 in A1 and A2 becomes 4. If you now enter 7 in A1, A2 becomes 11. If you then enter 9 in A1, A2 becomes 20.

    You can set this up with a macro.
    Is this what you want?
    Gary's Student

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Adding numbers in the same cell

    Yes this is exactly what I want with a twist. Not only do I need to update the number but I have to find the Part in goes to on the same row. there are 32 parts in that column. So I have to find it first the update it.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding numbers in the same cell

    Hi,

    I find it difficult to visualise what you describe. Can you give some specific examples please?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Adding numbers in the same cell

    Sorry Richard:
    One other thing, if this is done in a macro. Can the macro run when they hit the enter key after they put the number in the cell.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding numbers in the same cell

    Hi,

    Yes, you'd use a Sheet_Change macro to update the relevant line that contains the Quantity.
    I suggest that you add a third helper cell which uses an =MATCH() function to identify which row of your table contains the Part # you enter (either directly or via a drop down containing all part numbers) and then use that helper cell in the macro.

    Untested since I don't have direct access to Excel at the moment - but assuming the part numbers are all in column A, with quantities in Column B, the part number in say D1 and the Quantity to adjust in E1, with a helper cell in F1 which contains the function
    Formula: copy to clipboard

    =MATCH(D1,A:A,False)

    Name the helper cell say "UpdateRow"

    Now the macro would be

    Sub Worksheet_Change(ByVal Target As Range)
       If Not Intersect (Target, Range("E1")) Is Nothing Then
          Range("B" & Range("UpdateRow"))=Range("B" & Range("UpdateRow"))+Range("E1")
       End If
    End Sub

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding numbers in the same cell

    Hi,

    You would need to use a macro. Something like

    Range("A2") = Range("A2")+Range("A1")

  8. #8
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Adding numbers in the same cell

    I have an Inventory file and of to the side of the table I have two cells one for the part# and one for the amount the user will adjust their inventory by. They can't go to the Qt. cell because it is update by another function. So I need to find the Part # in one column and then update the Qt. in another column on the same row. Am I sounding nuts!

+ 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