+ Reply to Thread
Results 1 to 17 of 17

How to calculate time difference for duplicated entries

  1. #1
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    How to calculate time difference for duplicated entries

    Dear Excel expert

    Thank you in advance for your help.

    Please help me to find the differences in date when d column has value greater than 1, it means that companies in B column appears more than once. I would like to calculate the difference of their respective date (a column) when they appear more than once in e cloumn.

    For example b14 company appears two times in the row, in e14 column i have calculated their difference of date manually. When a company appears more than once I have also calculated their difference of date manually to give you an idea what i am looking for.

    Please help me.

    Thanks
    Shams
    Attached Files Attached Files
    Last edited by mahershams; 05-14-2014 at 10:26 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: countifs

    You'll need to do an array formula, i'll attach a quick demo.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    Re: countifs

    Hi

    Thank you very much for your help. Waiting for your feedback.

    Thanks a lot.

    Regards
    Shams

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: countifs

    Hi mahershams,

    1) how title "countifs" is realted to content of your question. Have you ever tried to use http://www.excelforum.com/search.php ??? Title of the post shall be "a short summary of the problem". See: http://www.excelforum.com/forum-rule...rum-rules.html :
    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search.
    ...
    If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    2) it's obvoius in case there are two occurences of one item. But you have not described which dates shall be taken into account when there are 3 or more occurences. I used latest-earliest. If other adjust the formula.
    in E2 array (Ctrl+Shift+Enter commited) formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    PS. Where is Ausralia? :-P
    Last edited by Kaper; 05-14-2014 at 08:03 AM.
    Best Regards,

    Kaper

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: countifs

    Hello

    Please see attached.

    I have used

    =IFERROR(INDEX($A$1:$A$9,SMALL(IF($B$2:$B$9=B2,ROW($B$2:$B$9)),2),1)-INDEX($A$1:$A$9,MATCH($B$2,$B$1:B9,0),1),"")

    Which is a little bit off, but would be a good starting place.
    Last edited by nathansav; 05-14-2014 at 08:14 AM. Reason: Forgot to lock the last index

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,507

    Re: countifs

    See if the attached updated workbook is what you are looking for.


    Regards, TMS
    Attached Files Attached Files
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: countifs

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  8. #8
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    Re: array formula

    Dear All

    Thank you very much for all your help.

    Kaper: I am shams from Melbourne. Thank you for your help. However, as you said, if there is more than two observation, it ignores the middle observation. However thank you so much.

    nathansav: Natansav I do not know there are something wrong when i copied the formula and past in work sheet. It did not give me any values for any cell. My bad. However thank you so much. If you have time, you can also help to find out whats going wrong in the formula.

    TMS: Thank you so much TMS for the reply which meet my requirement 100%. Thank you for your time. I really appreciate your time.

    Fotis: Thank your continuous guidance in the forum. Hope I will provide a good title next time.

    Thank you all of you.

    Regards
    Shams

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,507

    Re: array formula

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: array formula

    Quote Originally Posted by mahershams View Post

    Fotis: Thank your continuous guidance in the forum. Hope I will provide a good title next time.

    Regards
    Shams
    What is this that you don't understand in this...????

    ...Your post title should accurately and concisely describe your problem, not your anticipated solution.
    Did your new title describe any problem that i didn't noticed..??

    Sorry but i can not do anything more for you. Since yesterday i try to tell you that if you want to be a member here you have to comply with forum rules. You prefer to ignore me and continously break the rules.

    In this case soon you'll be a banned user. Good luck with whatever you decide to do.

  11. #11
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    Re: array formula

    Hi Fotis

    Sorry I could not get it how i break the thread title rule. I have changed the thread title according to the advice. I have just checked that there are other thread title like this " Blank Cells - Ruin Formula" in the thread.

    What should i put title in this case?

    Regards
    Shams

  12. #12
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    Re: array formula

    Hi Fotis

    According to the guideline of thread title "Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum" I did not put any of them in the thread title. According to the advice of member, who said that it would be array function instead of countif, I put the thread title as array formula. I request you please withdraw the infraction if possible.

    Thanks
    Shams

  13. #13
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    Re: array formula

    As you know there are different levels of users in the forum, I am a basic user sometimes it is very difficult for me to predict how to solve this problem as I am not familiar with so many excel codes. In that case if you just infract the user, then it will be against the core learning objective of this forum as this is a very good platform to get help and I really appreciate all of your help in this platform.

    We are here to get help and give help to others not to ban user on these ground.

  14. #14
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    Re: array formula

    Sumifs Query, Couponing chart, Analyzing survey data, Rental Escalation Formula, Array SUM formula with range of conditions, SMALL(If(AND ... Formula, If then, Conditional formatting there are so many thread title like this.

    I know I am wrong but it does not clear to me. You are highly experienced and I hope that you will do a good judgement.

  15. #15
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,632

    Re: array formula

    Hi Shams,

    1) What I expect the right title for such thread could be is for instance:

    How to calculate time difference for duplicated entries

    The title is not really for those who will to answer - They usually read daily number of posts with strange/not adequate titles. It is for those, who use search engine. And the forum is not just to help you (and others) but also to accumulate a knowledge base for active searching users.

    2) My (side) question was not: Where is Australia, but where is Ausralia - have a closer look on your profile data, and edit the location: http://www.excelforum.com/profile.php?do=editprofile

    Last but not least - thanks for reputation point - I did my best tu guess what result you are really looking for.

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,507

    Re: array formula

    Hi Shams,

    I agree with Kaper to a large extent. I don't bother too much about titles. If the question makes sense and I have enough information, I'll have a go at at solution. I'm MORE inclined to try and produce a solution if there's a sample workbook. If a title is obviously bad, I'll usually warn the OP that the Moderator(s) might take exception and ask them to change it. In this case, there had already been a few posts, so I didn't bother.

    Kaper is also right that the purpose of a good thread title is to make it more meaningful to other people searching the forum or just Googling an answer to their question. In this case, if someone were looking for COUNTIFS or Array Formula, they might come across this thread which probably wouldn't help them.

    Though, that said, my solution used:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    so you never know.

    So, Fotis is also correct in asking you to change your thread title. nathansav might have led you down the wrong path inadvertently by suggesting you needed an Array Formula. And, with over 200 posts, you should be expected to know better ... to be an experienced forum user, even if you are not an experienced Excel user

    The thing is that I've used COUNTIFS and Array Formula and INDEX/MATCH in this reply, so there's a good chance that anyone searching for those topics might come across this thread anyway.

    I think that Kaper's suggested thread title is a very good one ... but a little late in the day.

    It's probably best not to keep challenging the Moderator(s) as that probably won't help your case and maybe earn more infractions or get you banned ... not good.

    So, just draw a line and, next time, spend a little time trying to think of a thread title that summarises the problem you need to address. It doesn't mean you can't use COUNTIF, but maybe more in context. For example, "COUNTIF produces incorrect results" and the body of the thread explaining the background ... and a sample workbook. That title says you're using COUNTIF and you have a problem. Factual and it doesn't assume a solution.

    Thanks again for the rep.

    Kind regards, TMS

  17. #17
    Forum Contributor
    Join Date
    11-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    225

    Re: How to calculate time difference for duplicated entries

    Hi Kaper

    Thanks for reply. I have fixed the title once again. I never realise that we should give the title like this. I always think of indicating the code to solve the problem so that who are expert in those codes will have a look into the problem. Also most title thread you see, majority of them are using the code in their title heading. From now on, I will definitely provide the title like this.

    I really appreciate your time and efforts. Thanks for indicating the Ausralia.

    Regards
    Shams

+ 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. Using countifs in VBA
    By Willardio in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-01-2015, 04:55 AM
  2. COUNTIFS OR COUNTIFS needs to work
    By joshbellfi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-23-2013, 10:55 AM
  3. Countifs
    By mjr10891 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-30-2013, 06:33 AM
  4. COUNTIFS OR...multiple countifs without duplication in the numbers
    By HooligaD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 09:53 AM
  5. Replies: 0
    Last Post: 12-16-2011, 09:01 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