+ Reply to Thread
Results 1 to 6 of 6

How to write multiple IF statement

  1. #1
    Registered User
    Join Date
    09-13-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    20

    How to write multiple IF statement

    I have many part numbers which may be duplicated and I want to sum the qty shipped based on a few criteria. How would I write this?

    IF N4=C4 and K4 =T1 then sum F:F.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to write multiple IF statement

    Without a context, the formulas you posted don't have much meaning. Can you describe the criteria for us and post some sample data?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    09-13-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: How to write multiple IF statement

    The attached file shows the data that I am talking about. N4 in my initial post should be M4.

    Column M is the part number that I want to use as my reference part number.
    Column C is the part number based on lines sold, it could be input many times.
    Column K is the month shipped.
    T1 is the reference month that I used to illustrate the dollar amount sold.

    For example I would like to see if part number in M4 (example) matches date in column c and T1 matches K4 then sum the data in column F. The ultimate goal is I want to illustrate each month and the dollar amount sold for each part number. The problem is that I might have part number 122345 (example) listed 100 times and it needs to be summed under the correct month.

    Thanks for the help.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-13-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: How to write multiple IF statement

    No ideas???

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

    Re: How to write multiple IF statement

    So in your example, "IF M4=C4 and K4 =T1 then sum F:F" (note: it should be S1 not T1 as you have merged cells) where is this result going? U4?

    In any case, try this formula
    =SUMPRODUCT(--($C$2:$C$500=$M4),--($K$2:$K$500=S$1),($F$2:$F$500))

    Does that work for you?
    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

  6. #6
    Registered User
    Join Date
    09-13-2011
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: How to write multiple IF statement

    I think that will work. I have plugged it in and played with it a little. I think it might just get me to where I need to be. The main thing I needed was how to combine the conditions. You are awesome...Thanks a TON, I have been

+ 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