+ Reply to Thread
Results 1 to 9 of 9

Add value to total depending on content of cell

  1. #1
    Registered User
    Join Date
    10-14-2013
    Location
    Manchester UK
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    5

    Question Add value to total depending on content of cell

    Hi all.
    I have a problem that I'm finding difficult to find an answer for.

    the problem I have is that I want cell (Sheet 3; C4) to contain a sum of values from (sheet 1; column E),
    and here is the catch,
    IF (Sheet 3; C5) has a value that can be matched to a corresponding row cell in (sheet1; column B).

    So..... If I put the value 302 into cell (sheet 3; C5) I want the spreadsheet to go and find 302 in (sheet 1; column B) and then add the value it finds in
    (sheet 1;column E) on the same row to cell (sheet 3; C4)
    BTW. cell (sheet 3 ;C5) will look something like (302, 304, 750).

    I hope this makes sense.

    The problem is how to describe the problem I have.....

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Add value to total depending on content of cell

    Enter those conditions within the formula

    In C4 Cell of Sheet3

    =SUM(SUMIF(Sheet1!B:B,{302,304,750},Sheet1!E:E))


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    10-14-2013
    Location
    Manchester UK
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    5

    Re: Add value to total depending on content of cell

    Sixthsense. Thanks for the quick reply. and your solution does give me some things I didn't know.
    However.... the test is that add the value only if sheet 3; C5 contains a certain value, 302 in my example.
    So somewhere it's going to need something like (IF C5 contains 302,304,750)....

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Add value to total depending on content of cell

    I am unable to follow

  5. #5
    Registered User
    Join Date
    10-14-2013
    Location
    Manchester UK
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    5

    Re: Add value to total depending on content of cell

    OK. Sorry its my fault for not being able to describe my problem....
    I will try again... the logic is.
    I add a string to (sheet 3; C5) - for example "301", and I need the spreadsheet to find this string in (sheet 1; column B) and then add the corresponding value found in (sheet 1;column E) to the value of (sheet 3; C4).

    O I think I will just do it with a pencil.....

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Add value to total depending on content of cell

    Try this…

    In C4 Cell of Sheet3

    =SUMIF(Sheet1!B:B,C5,Sheet1!E:E)

  7. #7
    Registered User
    Join Date
    10-14-2013
    Location
    Manchester UK
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    5

    Re: Add value to total depending on content of cell

    OOOO so close.
    It works for one value, however, and again this is my fault for not explaining properly, the cell (sheet 1;C5) will contain 301, 302, 720, ....etc. and I want C4 to be the addition of all of these lookups into sheet 1.
    I was thinking I could do it with.
    =SUMIF(Sheet1!B:B,C5={301, 301, 720, , , , },Sheet1!E:E) ???

  8. #8
    Registered User
    Join Date
    10-14-2013
    Location
    Manchester UK
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    5

    Re: Add value to total depending on content of cell

    Sorry that should have read (sheet 3;C5) will contain.....

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Add value to total depending on content of cell

    In C4 Cell of Sheet3

    =SUMPRODUCT(SUMIF(Sheet1!B:B,C5:C10,Sheet1!E:E))

    Instead of keeping the values 301, 301, 720 in a single cell with comma separated, just enter each values in each cell from C5:C10 of sheet3 without comma. Extend the range C5:C10 based on your input requirement.

+ 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. Run different command depending on cell describing content
    By kayswiss in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2012, 01:43 AM
  2. [SOLVED] How to autofill a column with a cell content depending on content in another cell.
    By lul1971 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-17-2012, 12:33 PM
  3. open second userform depending on cell content
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2011, 05:26 PM
  4. Change ws3 Cell Content Depending On ws1 Content
    By heliskier89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2011, 04:52 PM
  5. Changing cell colour depending on content??
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2006, 07:55 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