+ Reply to Thread
Results 1 to 6 of 6

Using COUNTIF to count text derived by formula

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    21

    Using COUNTIF to count text derived by formula

    On the attached spreadsheet I am trying to create a report on the Weekly Analysis Sheet that shows the number of members who have worked out on each day of the week (Sunday, Monday, Tuesday, etc.) based on the information collected on the Log Sheet. I'd also like to break it down by morning, afternoon and evening hours, if that's possible.

    I've tried using the COUNTIF formula in A2 on Weekly Analysis, but as you can see it isn't working. Any Suggestions?

    David
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Using COUNTIF to count text derived by formula

    hi David. the column D in Log sheet is merely formatted as days. keep in mind that formatting cells only gives you a change presentation, not changing what it actually is. what it actually is, is still the Date in column B. so use this formula instead in D2:
    =TEXT(B3,"dddd")

    or in Weekly Analysis sheet:
    =SUMPRODUCT(--(TEXT(Log!$D$3:$D$32,"dddd")="Friday"))

    to break it down by morning, afternoon & evening; you need to tell us how you define the 3. say morning is 8 to 12pm. then:
    =SUMPRODUCT((TEXT(Log!$D$3:$D$32,"dddd")="Friday")*(MOD(Log!$C$3:$C$32,1)>=8/24)*(MOD(Log!$C$3:$C$32,1)<=12/24))
    change the ones in red to the timings you want

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    04-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Using COUNTIF to count text derived by formula

    That works, thanks!

    David

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Using COUNTIF to count text derived by formula

    Some of your data is incorrect.

    Column B has different times to what displayed in column C
    In particular
    B9 and C9
    and down as far as B32 and C32
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Registered User
    Join Date
    04-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Using COUNTIF to count text derived by formula

    Thanks for catching that! This is a test run and I modified some of the times in Column C to see the results.

    David

  6. #6
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Using COUNTIF to count text derived by formula

    you have gotten caught by the "formatting of data, is data" error
    Start with this in D3 of 'LOG' sheet:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    drag down
    then this in A2 of 'Weekly Analysis':
    =COUNTIF(Log!D3:D32,6)
    This will return the information your sample wants
    BUT we can get the whole week numbers quite easily
    IF you want them in columns, then in A2 'Weekly Analysis' sheet: (with Sunday as day 1 of week)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    drag to G2
    See Attached (.sol1)
    IF you want them in rows, then in A2 'Weekly Analysis' sheet: (with Sunday as day 1 of week)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    drag to A8
    See attached (.sol2)

    Hope this helps
    Attached Files Attached Files
    Last edited by dredwolf; 04-21-2013 at 12:06 AM.
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

+ 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