+ Reply to Thread
Results 1 to 10 of 10

Copy value in a cell to another cell based on value in a third cell.

  1. #1
    Registered User
    Join Date
    10-21-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Copy value in a cell to another cell based on value in a third cell.

    Hi All,
    Apologies for my opening post. Didn't realise that any spaces would be reduced to one, hence the scramble of the table to the left.

    I have updated the thread with a worksheet and explanation of what I am trying to achieve.

    We Have 3 Columns containing $ amounts, ( A,D and G), and 3 columns containing category numbers, (B, E and H).
    Upon entry of a category value (Column B, E and H), results in the $ amount to the left being added to the Categories 1 to 10 block, as shown.
    For clarity the $ signs have bee omitted.
    All of the above will be in one work sheet.

    A solution to this chalange would be greatly appreciated.

    Cheers, Steve
    Attached Files Attached Files
    Last edited by SteveZed; 05-17-2018 at 06:38 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Copy value in a cell to another cell based on value in a third cell.

    Attach a sample workbook (not image).

    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
    Registered User
    Join Date
    10-21-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Copy value in a cell to another cell based on value in a third cell.

    Hi All,

    As no solution has been offered, I assume I was not clear on what was needed. So I will try again.
    Included is a Workbook.

    We have 3 banking accounts, ie Acct 1, Acct 2, Acct 3, with a category for each account.
    When a category value is entered after the payment, the payment amount is added to the corresponding column in the Categories Table (columns K to T). When a payment or the category is changed, this is reflected in the Categories Table.
    So each row in the Categories Table reflects what is in the Payments Accounts for that row.

    For example:
    Row 4: B4 = 1, add A4 to K4 giving total in K4 = 10
    Row 5: E5 = 2, add D5 to L5 =20
    Row 6: H6 = 5, add G6 to O6 = 30
    Row 7: B7 = 1, E7 = 1, H7 = 1, add 10+20+30 to K7=60

    I hope that this illustrates what I am trying to achieve.
    I have no knowledge of VBA, so I was hoping this can be done in formulas.

    Help for a solution would be greatly appreciated.

    Cheers,
    Steve
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Copy value in a cell to another cell based on value in a third cell.

    Remove the "divider" columns so data is contiguous

    in I4

    =SUMPRODUCT(($A4:$E4)*($B4:$F4=I$3))

    Copy across and down
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-21-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Copy value in a cell to another cell based on value in a third cell.

    Hi John,

    Thank you so very much for this seemingly simple solution to a problem I thought was far more complex, based on the time I have spent on it.


    Cheers,
    Steve

  6. #6
    Registered User
    Join Date
    10-21-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Copy value in a cell to another cell based on value in a third cell.

    Hi John,

    Is it possible to have blanks in the cells that have zeros, for visual simplicity of the Categories Table?

    Cheers,
    Steve

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Copy value in a cell to another cell based on value in a third cell.

    CUSTOM Format the cells as 0;;;@

  8. #8
    Registered User
    Join Date
    10-21-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Copy value in a cell to another cell based on value in a third cell.

    Hi John,

    The solution "=SUMPRODUCT(($A4:$E4)*($B4:$F4=I$3))" works just fine.
    When I add another pair of Payments and Category, in columns G & H, I can't get this to work. I don't seam to grasp what "I3" (tried I4) at the end stands for.

    Also have trouble to Custom Format the cells as 0;;;@. Is the procedure to implement this as follows: Select the Categories Table, then click Data in the Menu, in Data tools select Data Validation, Allow Custom, Formula 0;;;$ . The zeros remain.

    Thanks for your help to date.

    Steve

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Copy value in a cell to another cell based on value in a third cell.

    I$3 is the Category number which changes to J$3,K$3 as the formula is dragged across the cells : starts at K with new formula below.

    =SUMPRODUCT(($A4:$G4)*($B4:$H4=K$3))

    To format:

    Select the range (K4 to T 1 or U11)

    Right click

    Format cells

    Custom

    enter 0;;;@

  10. #10
    Registered User
    Join Date
    10-21-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Copy value in a cell to another cell based on value in a third cell.

    Hi John,

    Thank you so much again.

    Your solutions works beutifuly. Simple solutions to my complex problems.

    Steve

+ 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. Copy and Paste Cell X number of times based on Adjacent Cell
    By GabeGabe in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-07-2016, 11:40 AM
  2. Replies: 6
    Last Post: 11-19-2015, 09:36 PM
  3. [SOLVED] Find a row based on cell value, copy cell in different column, paste below
    By gaker10 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-02-2014, 07:12 AM
  4. [SOLVED] copy cell values in one cell based on value of adjacent cells
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2014, 08:48 AM
  5. Replies: 2
    Last Post: 01-31-2014, 09:34 AM
  6. Copy Cell to next empty cell on other worksheets based on date and category
    By mainebf in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-04-2012, 02:43 PM
  7. Replies: 3
    Last Post: 07-15-2010, 08:49 AM

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