+ Reply to Thread
Results 1 to 8 of 8

How do I add cells from different sheet based on the value of one cell in a sheet?

  1. #1
    Registered User
    Join Date
    01-13-2013
    Location
    Boston
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    3

    How do I add cells from different sheet based on the value of one cell in a sheet?

    Hi all,

    I've been looking but cannot find this in other posts. I am trying to add cells, across sheets, based on the value of other cells.

    For example, in my workbook, there is a sheet "Actual Spend". I'd like to add a number from the column Operation (or Capital) to a cell in sheet "Budget MTD & YTD". That by itself is not the issue.

    Where I get confused is how to find the code in "Actual Spend", column B, find the month in "Actual Spend", column D and then add the value found in "Actual Spend", column E (or F) to the corresponding column containing the month (e.g. column H) and code (e.g. row 9) in sheet "Budget MTD & YTD".

    Does my explanation help? If not, please ask for clarification and I'll do my best to explain better.

    Forum spreadsheet.xlsx

    Thank you all for any assistance.

    Regards,
    George

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

    Re: How do I add cells from different sheet based on the value of one cell in a sheet?

    Assuming there could be multiple matches, You might want SUMIFS

    For H9 for example

    =SUMIFS('Actual spend'!$B$2:$B$7, $B9, 'Actual Spend'!$D$2:$D$7, H$7, 'Actual Spend'!$F$2:$F$7)

    However, your month abbreviations should be consistant (i.e. all 3 characters)
    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

  3. #3
    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,370

    Re: How do I add cells from different sheet based on the value of one cell in a sheet?

    In H9

    =IFERROR(INDEX('Actual spend'!$E$2:$F$7,MATCH(1,($B9='Actual spend'!$B$2:$B$7)*('Actual spend'!$D$2:$D$7=H$8),0),1),"")

    In h15

    =IFERROR(INDEX('Actual spend'!$E$2:$F$7,MATCH(1,($B15='Actual spend'!$B$2:$B$7)*('Actual spend'!$D$2:$D$7=H$14),0),2),"")

    Enter both formulae with Ctrl+Shift+Enter: Copy across and down

    Make text months in both sheets consistent (Jan & Jan OR January and January)

  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,370

    Re: How do I add cells from different sheet based on the value of one cell in a sheet?

    ChemistB is correct: use SUMIFS (as stupidly I only thought of one value per item!)

  5. #5
    Registered User
    Join Date
    01-13-2013
    Location
    Boston
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    3

    Re: How do I add cells from different sheet based on the value of one cell in a sheet?

    Hi ChemistB & JohnTopley,

    Thank you for the responses. I tried ChemistB's suggestion but am getting a #VALUE! error. I also made the changes you both suggested regarding consistency with the months, (thank you).

    Forum spreadsheet.xlsx


    Thank you again for the help and information.
    George
    Attached Files Attached Files

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: How do I add cells from different sheet based on the value of one cell in a sheet?

    Try the below formula in H9 and copy across
    =SUMIFS( 'Actual spend'!$F$2:$F$7,'Actual spend'!$B$2:$B$7,$B9, 'Actual spend'!$D$2:$D$7,H$8)
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  7. #7
    Registered User
    Join Date
    01-13-2013
    Location
    Boston
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    3

    Re: How do I add cells from different sheet based on the value of one cell in a sheet?

    nflsales,

    Thank you! I had to tweak it a little, but that seems to be the solution.

    I learn a lot form this forum with this being the first time I've asked for assistance. The response was terrific and I appreciate all the contributors. Someday, I hope to contribute as well!

    Thank you again,
    George

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

    Re: How do I add cells from different sheet based on the value of one cell in a sheet?

    My mistake, I put the sum range last when it should have been first.

+ 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] Save sheet to new sheet and name it based on date on first sheet cell
    By dwheggen1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2015, 12:25 PM
  2. Auto fill static cell on separate sheet based on changing cells in another sheet
    By lawrence24 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-15-2014, 12:31 PM
  3. Replies: 1
    Last Post: 02-13-2014, 04:45 PM
  4. [SOLVED] Locating a cell in sheet 2, based on 2 variables in sheet 1. Result into sheet 1.
    By Gezza24 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-05-2013, 12:50 AM
  5. [SOLVED] Macro to Copy Data from one Sheet A to Sheet B based on value in cell on sheet A
    By scass in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 07:21 PM
  6. Replies: 4
    Last Post: 03-01-2012, 01:05 PM
  7. Macro to add sheet, name it based on previous sheet, and delete a range of cells
    By Moeshell in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2011, 03:26 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