School Project - Need help to setup function.

Enigma909

New member
Joined
Apr 20, 2021
Messages
2
Reaction score
0
Points
0
Excel Version(s)
365
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
 
Update

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/threa...-help-to-setup-function.1168589/#post-5678175

https://www.excelforum.com/excel-fo...ect-trying-to-setup-function.html#post5505618
 

Attachments

  • School Project.xlsx
    9.4 KB · Views: 7
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:
i meant "Apple's" end to "Emerald's" start.
 
Last edited:
Back
Top