+ Reply to Thread
Results 1 to 11 of 11

calculate amount of days by name

  1. #1
    Forum Contributor
    Join Date
    02-27-2015
    Location
    Los Angeles, California
    MS-Off Ver
    office 2010 pro
    Posts
    238

    calculate amount of days by name

    hi guys, my name is rachel, i have a quick question, hope someone can help:

    I have a workbook where:

    Column A = Date such as 2/1/03
    Column B = Day that corresponds with Column A (2/1/03 = Wednesday)
    Column D = Cell D2 = Total amount of Wednesdays from cell range B2:B17
    Column E = Cell E2 = Total amount of Saturdays from cell range B2:B17

    I know how to calculate the sum of each, but my problem is when i run into duplicates that correspond to the date such as:

    2/1/03
    2/22/03
    7/9/03
    10/25/03
    12/25/03

    These dates have duplicates so i don't want to count the corresponding day twice.

    There should be 7 Wednesdays and 4 Saturdays.

    Can anyone provide a formula for this, in cells D2 & E2? Thanks in advance to anyone who takes the time to help me!!
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: calculate amount of days by name

    How about using the advanced filter on the data tab of the ribbon. Filter for unique items.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    02-27-2015
    Location
    Los Angeles, California
    MS-Off Ver
    office 2010 pro
    Posts
    238

    Re: calculate amount of days by name

    well I want the sums to be on a separate page. I've never used the advanced filter tab, so im not familiar with how it works.

    I'm using two separate pages with multiple rows of data for each year. Not sure how to use the advanced filter, is there a formula instead?

    I assume i just filter the date and day column and then calculate the amount of times each day appears in separate columns on a different page, but this would require me to create a duplicate column to filter and calculate from.
    Last edited by RachelMads02; 09-03-2016 at 12:19 AM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: calculate amount of days by name

    here is a short tutorial on filtering for unique values. Once you have filtered them to a new page you can then apply countif function.

    https://support.office.com/en-us/art...1-8daaec1e83c2

  5. #5
    Forum Contributor
    Join Date
    02-27-2015
    Location
    Los Angeles, California
    MS-Off Ver
    office 2010 pro
    Posts
    238

    Re: calculate amount of days by name

    i can't adjust the column of dates as they are linked to other data, i'd have to create two duplicate columns to filter from or copy both current columns in the advanced filter options to another location to the do the calculation; either way i have to add more columns to an already extensive workbook. That only clutters up my page even more, is it necessary?
    Last edited by RachelMads02; 09-03-2016 at 12:42 AM.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: calculate amount of days by name

    Place the filtered data in a remote section of your worksheet. You do not need to adjust the current dataset. Once you have run the filter, you can hide the remote columns so it does not affect your presentation.

    Alternatively, a VBA solution may be available. I am too tired to work on that tonight. Will check back later if someone else has not checked in on this.

  7. #7
    Forum Contributor
    Join Date
    06-28-2016
    Location
    Pennsylvania, USA
    MS-Off Ver
    2013
    Posts
    308

    Re: calculate amount of days by name

    I did it with a few helper columns, which you can hide. Might be an easier way, but this works. I also made it so u can drag it to the right for further days.
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: calculate amount of days by name

    Change the answer headers from Wednesdays and Saturdays to Wednesday and Saturday and then use this array formula in D2, copied across:

    =SUM(IF(FREQUENCY(IF($B$2:$B$17=D$1,$A$2:$A$17),IF($B$2:$B$17=D$1,$A$2:$A$17))>0,1))

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

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

    Re: calculate amount of days by name

    C1 =if(countif($A$2:$A2,$A2)>1,"",1) and drag down to count the unique values.

    After that a pivot table (to analyze the data).

    See the attached file.

    Edit:

    since there where forumissues I could not upload the file in the original post.
    Last edited by oeldere; 09-03-2016 at 03:49 AM.
    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.

  10. #10
    Forum Contributor
    Join Date
    02-27-2015
    Location
    Los Angeles, California
    MS-Off Ver
    office 2010 pro
    Posts
    238

    Re: calculate amount of days by name

    ok thank you guys, i appreciate the options.

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

    Re: calculate amount of days by name

    You're welcome. We appreciate the feedback!

    Thanks for marking the question solved.

    It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

+ 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] Calculate a date dervied from 3 cells + calculating the amount of spec days.
    By RachelMads02 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-02-2016, 09:57 AM
  2. [SOLVED] Calculate Projected Annual amount from Dollar value (Amount) and varying time intervals
    By old dawg in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-16-2016, 07:29 PM
  3. [SOLVED] How to calculate debtors ageing amount in days on FIFO basis
    By King_BD in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-20-2015, 10:57 PM
  4. Replies: 2
    Last Post: 11-21-2014, 09:35 AM
  5. Calculate amount of days per year within range
    By constructionbart in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-20-2014, 05:24 AM
  6. Replies: 6
    Last Post: 02-23-2010, 04:41 AM
  7. How can I calculate amount of time left based on amount spent?
    By KLD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-23-2006, 11:25 AM

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