+ Reply to Thread
Results 1 to 6 of 6

Trying to edit a formula, to don't sum duplicates

  1. #1
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Trying to edit a formula, to don't sum duplicates

    Hi everyone
    I am trying to edit this formula to don't calculate duplicates, but I am not succeeding. The formula is:

    Please Login or Register  to view this content.
    I will try to explain better... The formula calculates the duration of some events from another sheet that are added automatically by a PowerAutomate script that adds to the Database Master sheet events from Google Calendar. We will take as an example the 10th of March. They are duplicates because they happen on the same day at the same time, as you can see from the screenshot below.

    screenshot_20230322_122852.png

    The formula I have created sums the duration of the events per each day so that I get the total in the cell of another sheet, 'Calcolo Giornaliero' what I am trying to achieve is that I want the formula only to calculate 1hour if the starting time is the same for that day.

    screenshot_20230322_123707.png

    Instead of 15:00 in cell E17, I expect 12:00 after removing the duplicates from the first screenshot. The same should reflect in the 'Calcolo Mensile' sheet where I get the total hours per each month, but also, in there duplicates are included. Do you have any ideas on how I can modify the formula to fix it?
    Thanks in advance for any help provided
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: Trying to edit a formula, to don't sum duplicates

    I'm not sure if this is in your version? but try Sum & Unique functions.......
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ~ you have to put in your Range.

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Trying to edit a formula, to don't sum duplicates

    one option:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Re: Trying to edit a formula, to don't sum duplicates

    Thank you, @queuesef, for taking the time to reply.

    @XLent, your solution works perfectly. Do you have any idea how we could put something similar in the sheet 'Calcolo Mensile' where I get the total for each month? Instead of this formula?

    Please Login or Register  to view this content.

    Thanks a lot

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Trying to edit a formula, to don't sum duplicates

    if I've understood...same principle/logic

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-04-2021
    Location
    London England
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2212 Build 16.0.15928.20000) 64-bit
    Posts
    27

    Re: Trying to edit a formula, to don't sum duplicates

    This formula works perfectly, and I thank you for your time and effort.

    Ultimately I realized that the calculation was still not giving me the desired result, so I came up with another formula:

    in E17 of 'Calcolo Giornaliero':

    Please Login or Register  to view this content.
    This calculates the earliest time of the day's first event and the latest of the day's last event. In the example of the 10th of March, in the first screenshot of the thread, that would be from 09:30 to 20:00. Then the formula subtracts the time from 12:30 to 14:00, so my client will add another event to the calendar called 'pausa', and the formula finds that event and subtracts the duration of it from the total hours.

    It will then be:

    Please Login or Register  to view this content.
    and that's exactly the amount of hours he works in the day

    What I am struggling with now is adapting this formula to sum the total hours for the month in D4 of the 'Calcolo Mensile' sheet. I was hoping you could help. For some reason, I cannot attach images or the .xls file to this reply, so I will put screenshots for a clearer explanation and the updated file in a folder in my OneDrive.

    That you find here:
    https://1drv.ms/f/s!AnzCEK8poKX0ioQJ...SeUMQ?e=JYHwsa

    Thanks again for your help

+ 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. Replies: 6
    Last Post: 11-27-2018, 07:17 AM
  2. Replies: 1
    Last Post: 07-30-2014, 02:37 PM
  3. [SOLVED] USERFORM -Trying to do Find all_button (Duplicates and edit individually)
    By John Cruz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-26-2014, 09:58 AM
  4. Replies: 6
    Last Post: 12-10-2013, 02:43 AM
  5. Edit existing VBA to remove duplicates and include conditional?
    By MargyHall in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2013, 06:07 AM
  6. Macro to search for duplicates and edit them
    By jkay2089 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2012, 06:38 AM
  7. Replies: 2
    Last Post: 03-20-2011, 11:19 AM

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