+ Reply to Thread
Results 1 to 6 of 6

Advanced 'If, Then' formula needed (I think)

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    19

    Advanced 'If, Then' formula needed (I think)

    Good Morning,

    I'm wondering if anyone can please help me find out a formula to add the dolar amounts in one column if the terms are met in another column. For Example:

    Here is example data to illustrate my problem:

    Colors Dollar Amount from Selling Colors
    Blue $20
    Green $15
    Green $10
    Blue $20
    Yellow $35
    Blue $10
    Red $15

    I would like to create a formulas that would would total the amounts of Blue Dollars Sold, Green Dollars Sold, Yellow Dollars sold, etc. Can anyone please assist? It would be greatly appreciated.

    Thank you,
    Last edited by kas05j; 03-25-2014 at 11:31 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Advanced 'If, Then' formula needed (I think)

    Hi, you need to use the SUMIF function. for example:
    =SUMIF(A1:A100,"Blue",B1:B100)
    will sum all the values in B1:B100 if the corresponding value in column A is equal to "Blue"

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Advanced 'If, Then' formula needed (I think)

    In D2

    =IFERROR(INDEX($A$2:$A$8,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$2:$A$8),,),)),"")
    and pull formula down

    In C2

    =SUMIF($A$2:$A$8,D2,$B$2:$B$8)
    and pull formula down




    A
    B
    C
    D
    1
    Color Value Sum Unique Colors
    2
    Blue
    $20
    50
    Blue
    3
    Green
    $15
    25
    Green
    4
    Green
    $10
    35
    Yellow
    5
    Blue
    $20
    15
    Red
    6
    Yellow
    $35
    7
    Blue
    $10
    8
    Red
    $15
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    12-13-2013
    Location
    jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Advanced 'If, Then' formula needed (I think)

    Ragulduy, the formula worked perfectly. I just have one more question, how would you word the formula if you wanted to do one that had more than one color. I've included an example of what im talking about below (But the example doesnt work )

    =SUMIF(A1:A100,"Blue,Yellow",B1:B100)

    Thank you!

    Also, I have yet to try AlKey's formula, but i will try it now to compare the results.

    Thanks again!

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Advanced 'If, Then' formula needed (I think)

    =SUMIF(A1:A100,"Blue",B1:B100)+SUMIF(A1:A100,"Yellow",B1:B100)

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Advanced 'If, Then' formula needed (I think)

    Quote Originally Posted by ragulduy View Post
    =SUMIF(A1:A100,"Blue",B1:B100)+SUMIF(A1:A100,"Yellow",B1:B100)

    You can actually do like this

    =SUM(SUMIF(A1:A100,{"Blue","Yellow"},B1:B100))

+ 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. Formula Needed for an Advanced Spreadsheet to Determine Inventory Count
    By bsherman in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-23-2014, 08:14 PM
  2. Advanced Formula Help Needed!!!
    By mgabes in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-05-2013, 09:35 AM
  3. Vlookup advanced - might be a different formula needed (Return cell value)
    By tdearling in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-12-2013, 01:49 PM
  4. Advanced Formula Help Needed!!!!
    By disco dave in forum Excel General
    Replies: 1
    Last Post: 09-01-2009, 05:30 AM
  5. Replies: 2
    Last Post: 07-21-2006, 10:05 AM

Tags for this Thread

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