+ Reply to Thread
Results 1 to 6 of 6

Average by Date and other criteria.

  1. #1
    Registered User
    Join Date
    09-26-2018
    Location
    El paso
    MS-Off Ver
    Excel 2016
    Posts
    3

    Question Average by Date and other criteria.

    Hello guys, my name is Daniel and I new in the forum.

    My problem is the follow.

    I need to get the average for date and other criteria. This book is update everyday for example:

    Sheet: Calculates
    Column A Column C Column D Column H
    Date Machine Number Cell EOE
    September 12 Mego-16 1 50%
    September 12 Mego-17 1 30%
    September 12 Mego-18 1 27%
    September 12 Mego-19 1 41
    September 12 Mego-20 1 19%
    September 12 Kom-23 2 32%
    September 12 Kom-25 2 12%
    September 12 Kom-26 2 8%
    September 12 Kom-27 0 51
    September 12 Kom-28 0 19%
    September 11 Mego-16 1 32%
    September 11 Mego-17 1 12%
    September 11 Mego-18 1 8%
    September 11 Mego-19 1 51
    September 11 Kom-21 2 19%

    Step 1: Filter Date (Example September 12)
    Step 2: If Cell (Number 1, 2, 3, 4 etc) exists in the Sheet "Machines") then
    Step 3: Calculate average of column H (EOE) by cell

    Results in another sheet:

    Date Cell EOE%
    September 12 1 34%
    September 12 2 18%

    How can I do this?

    I have this Macro to filter the dates but it's not working, my date is of type Text.

    Please Login or Register  to view this content.
    Could you help me, please.

    Is necessary a Macro or maybe it can be done with a formula, I don't expert in Excel.

    Thanks in advance.

    Daniel

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Average by Date and other criteria.

    Hi Daniel and welcome to the forum

    You could probably try using Averageifs() for this, but cannot say for sure without seeing some sample data and expected outcomes, to play with.
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-26-2018
    Location
    El paso
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: Average by Date and other criteria.

    Thanks, I uploaded the file.

    Thanks for answering.

    Daniel
    Attached Files Attached Files

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Average by Date and other criteria.

    How your expected result show as below

    Date Cell EOE%
    September 12 1 34%
    September 12 2 18%

    Can you please explain it ?
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    09-26-2018
    Location
    El paso
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: Average by Date and other criteria.

    I'm sorry

    I had updated the Sheet "AVGResults" with some notes.

    1.JPG

    Thanks

    Daniel
    Attached Files Attached Files

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Average by Date and other criteria.

    I am not entirely certain I understand what all you want in A3:C6. I shadowed those with these formulas in D3:F6.

    Of note: those dates in column A of 'Calculates' are not dates. They are text that look like dates. If you are not aware of it dates are numbers starting with day 1= 1 - Jan - 1901. Today is 27 - Sept - 2018 or day 43370 from 1 - Jan - 1901. The formatting is cosmetic.

    To coerce those text "dates" into their numeric values note the double unary "--" inside the MAX function. That is one method of coercion. Any math operator will have this effect.



    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    SHOW RESULTS
    2
    Date
    No. Cell
    EOE%
    Date
    No. Cell
    EOE%
    3
    12-Sep
    1
    31%
    12-Sep
    1
    31%
    In D3: =MAX(--Calculates!$A$2:$A$11987)-COUNTIF($E$3:E3,E3)+1
    In E3: =MOD(ROWS(E$3:E3)-1,2)+1
    In F3: =AVERAGEIFS(Calculates!H:H,Calculates!A:A,D3,Calculates!D:D,E3)
    4
    12-Sep
    2
    47%
    12-Sep
    2
    47%
    5
    11-Sep
    1
    34%
    11-Sep
    1
    34%
    6
    11-Sep
    2
    45%
    11-Sep
    2
    45%
    Dave

+ 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] Sort by largest, 2nd criteria by less than average %, 3rd criteria pre defined heading.
    By deanusa in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-01-2015, 12:27 PM
  2. Replies: 4
    Last Post: 08-27-2014, 01:36 PM
  3. Average of previous 6 entries with 2 criteria using date.
    By ayrmad in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2013, 07:47 PM
  4. [SOLVED] Average Based on Dynamic Date Criteria
    By jacob@thepenpoint in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-17-2012, 03:00 PM
  5. Average of cells matching date criteria ignoring DIV/0
    By wiggum in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2011, 04:48 AM
  6. Replies: 5
    Last Post: 05-05-2010, 10:32 AM
  7. Calculate average based on date and other criteria
    By Kycajun in forum Excel General
    Replies: 3
    Last Post: 07-14-2006, 05:15 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