Recording the difference between two date cells associated with a value on another cell

Hello All,

I have two locations where vehicles are going and spending time being worked on. I want to record the days each vehicle spends at each location. I cant seem to be able to count the difference between dates based on location. Thanks


Answers

  • Jen Lange
    Jen Lange ✭✭✭✭✭
    edited 04/28/21

    @Marcelo Maceira , I'm not sure I understand your use case, based on the image. Are you trying to acquire the number of days in a separate column (not displayed) for each row?

    In that case, add a column with either of the following column formulas to count calendar days or business days respectively, where the dates would reference the date cells contained in your sheet:

    =NETDAYS([Chassis Arrival Date]@row, [PDI End Timestamp]@row)

    =NETWORKDAY([Chassis Arrival Date]@row, [PDI End Timestamp]@row)

    If this isn't the use case you're trying to achieve, please clarify.


  • Thank you for your message Jen. Sorry for not being more descriptive of what I'm trying to do here.

    I've got as far as counting the days for each row. Now I'm stuck at separating the count for YUMA and for CVS. How do I bring in the PDI Location column into the equation so it recognizes which ones are YUMA and which are CVS?

  • @Jen Lange Here is a look at what I'm trying to do:

    The formula for Days at Location is =NETWORKDAYS([Truck In]1, [Truck Out]1)

    I am now trying to only count for each location. I tried =NETWORKDAYS([Truck In]1, [Truck Out]1), Location@row, = "YUMA" but it doesn't work. Any help would be appreciated.

    Thanks

  • Jen Lange
    Jen Lange ✭✭✭✭✭

    @Marcelo Maceira , did you use an IF statement in each corresponding column?

    =IF(Location @row = "YUMA",NETWORKDAYS([Truck In]1, [Truck Out]1),"")

    =IF(Location @row = "CVS",NETWORKDAYS([Truck In]1, [Truck Out]1),"")

    =IF(Location @row = "BODY",NETWORKDAYS([Truck In]1, [Truck Out]1),"")

    Let me know if this works for you.

    -Jen

    

  • @Jen Lange That was it! I'm kicking myself for not getting it on my own. Thanks for your help Jen!

  • Jen Lange
    Jen Lange ✭✭✭✭✭

    Oh good. I'm glad I was able to help, @Marcelo Maceira.

    Thank you for your engagement and contribution to our community. Your inquiry is likely to assist other members across time.

    If you appreciate my response, please recognize the effort by accepting my answer, as well as with an "Insightful" or "Vote Up" selection. Thanks!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!