+ Reply to Thread
Results 1 to 9 of 9

If x and y and date then total

  1. #1
    Registered User
    Join Date
    08-26-2022
    Location
    New York
    MS-Off Ver
    16.64
    Posts
    5

    If x and y and date then total

    I have a complicated formula that I just can't put together and hoping you gurus can help.

    On Sheet1 I need to total everything that matches the word in column A ("TYPE") from Sheet2, And Matches a specific Brand (Ex. brand) in Column C in the month of January from the dates in column B

    TOTAL D2:D9 IF (SHEET1:A2 EQUALS SHEET2:A2:A9) & IF (Column C = "Brand") & MONTH(SHEET2:B2:B9) = JANUARY

    I've tried different formulas with SUMS, SUMIFS, MONTH() and VLOOKUPS and think I just don't know enough about all the formulas. I could code this in a different language so I'm eager to see how it translates.

    In Basic English I need to know what was spent in a certain category for a certain brand during a certain month.

    THANK YOU!

    sample (1).xlsx
    Attached Files Attached Files
    Last edited by brandonla7; 08-26-2022 at 08:08 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: If x and y and date then total

    I used B2 to specify the Brand (Brand or Company in your sample file), and C2 to specify the month number (1=January, 12=December etc.), and then used this formula in D2 to get the total:

    =SUMIFS(Sheet2!D:D,Sheet2!A:A,A2,Sheet2!C:C,B2,Sheet2!B:B,">="&DATE(2022,C2,1),Sheet2!B:B,"<="&EOMONTH(DATE(2022,C2,1),0))

    You can obviously change the values in A2:C2 to get other totals.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-26-2022
    Location
    New York
    MS-Off Ver
    16.64
    Posts
    5

    Re: If x and y and date then total

    Thanks Pete for your quick response. I entered in the formula and produced an error. I'm trying to tinker with it and noticed that there was no "Brand" and C2 was referenced without a sheet2. I'll keep trying, but further assistance is appreciated. Also, B2 was referenced and that is where the formula would go. Let me take your directions a little further as well. I may have just dived in too fast.
    Last edited by brandonla7; 08-26-2022 at 08:55 PM.

  4. #4
    Registered User
    Join Date
    08-26-2022
    Location
    New York
    MS-Off Ver
    16.64
    Posts
    5

    Re: If x and y and date then total

    Entered in what you said and was not able to produce a total.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: If x and y and date then total

    Re-read my first sentence. I used D2 for the formula, as that gave me room to use C2 for the month and B2 for the brand.

    Pete

  6. #6
    Registered User
    Join Date
    08-26-2022
    Location
    New York
    MS-Off Ver
    16.64
    Posts
    5

    Re: If x and y and date then total

    Okay. Thought I did that. Just tried it again and it WORKED. You were right. Is there any way I can put those two options within the formula. 1 for January and "Brand" for brand? That way I don't have to dirty up the spreadsheet with more columns. THANK YOU!

  7. #7
    Registered User
    Join Date
    08-26-2022
    Location
    New York
    MS-Off Ver
    16.64
    Posts
    5

    Re: If x and y and date then total

    I replaced B2 with "Brand" and C2 with 1 and achieved the result. Thank you for your help. I really appreciate it.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: If x and y and date then total

    That's good to hear, and thanks for the rep.

    I was just trying to make it more flexible for you, so that you could change the brand and/or the month without having to modify the formula.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Pete

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: If x and y and date then total

    A formula to determine the month and year,


    With a Pivot Table.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ 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] Add multiple Date Dif together to get total length of service, if date blank, use TODAY
    By Kanderton in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-30-2022, 02:59 PM
  2. [SOLVED] Form a total days date based on a date and a total number of days
    By choletseng in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-15-2022, 07:11 PM
  3. Replies: 2
    Last Post: 02-24-2021, 02:56 PM
  4. Replies: 2
    Last Post: 07-09-2017, 07:23 AM
  5. Replies: 24
    Last Post: 10-08-2014, 10:31 AM
  6. Replies: 0
    Last Post: 01-28-2014, 07:37 AM
  7. Replies: 2
    Last Post: 10-06-2013, 02:03 PM

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