Results 1 to 4 of 4

Thread: School Project - Need help to setup function.

  1. #1
    Neophyte Enigma909's Avatar
    Join Date
    Apr 2021
    Posts
    2
    Articles
    0
    Excel Version
    365

    School Project - Need help to setup function.



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello I am writing a school project and I am having trouble setting up a function.


    I have some unique ID’s in the first column, different names in the second column, start dates in the third column and end dates in the fourth column.


    I am trying to create a function that says for unique ID “1”, if name “A” comes before name “B” what is the difference between end date “A” and start date “B”. I hope this makes sense.


    I was thinking about using an IF AND function but I can’t make it work.


    An example could be: For ID “1” if “Apple” appears before “Pears” what is the difference between 01.02.19 and 04.02.19.
    The function should return: 3 days in a new column, and it should then continue to the next unique “ID” which is “2”.


    I really hope that you can help me.


    Best regards

  2. #2
    Neophyte Enigma909's Avatar
    Join Date
    Apr 2021
    Posts
    2
    Articles
    0
    Excel Version
    365

    Update

    Quote Originally Posted by Enigma909 View Post
    Hello I am writing a school project and I am having trouble setting up a function.


    I have some unique ID’s in the first column, different names in the second column, start dates in the third column and end dates in the fourth column.


    I am trying to create a function that says for unique ID “1”, if name “A” comes before name “B” what is the difference between end date “A” and start date “B”. I hope this makes sense.


    I was thinking about using an IF AND function but I can’t make it work.


    Best regards
    The problem I am having is that I have 80 k rows + and that I need to code them on names and not on cells. The Formula would work perfectly if dont for a few cells.

    For ID 4 Does Apple come before Emerald, if yes, how many days between end date for Apple and Start date for Emerald.

    I really hope that you can help me.


    I have posted this problem on different Excel help forums.

    https://www.mrexcel.com/board/thread.../#post-5678175

    https://www.excelforum.com/excel-for...ml#post5505618
    Attached Files Attached Files

  3. #3
    Seeker Roger Haney's Avatar
    Join Date
    Jan 2021
    Posts
    11
    Articles
    0
    Excel Version
    Microsoft Excel Office 365
    i am not sure if I clearly understand your intent. As a start, this solves "Apples" start until "Emerald's end Date : =IF(MATCH("Apple",B:B,0)<MATCH("Emerald",B:B,0),ABS((INDEX(D : D,MATCH("Apple",B:B,0),1))-(INDEX(C:C,MATCH("Emerald",B:B,0),1)))). It seems that your intent may be more complex than I understand it to be. Please advise.
    Last edited by Roger Haney; 2021-04-25 at 12:44 AM.

  4. #4
    Seeker Roger Haney's Avatar
    Join Date
    Jan 2021
    Posts
    11
    Articles
    0
    Excel Version
    Microsoft Excel Office 365
    i meant "Apple's" end to "Emerald's" start.
    Last edited by Roger Haney; 2021-04-25 at 12:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •