Duration column formula: two situations

Brooks
Brooks ✭✭✭✭
edited 10/27/21 in Formulas and Functions

Hello,

I have three date columns involved in the duration:

Date Submitted

Date Completed

For Future Requests

My current duration formula only uses the Date Submitted and Date Completed columns:

=IF(Status@row <> "Complete", NETWORKDAYS([Date Submitted]@row, TODAY()), NETWORKDAYS([Date Submitted]@row, [Date Completed]@row))

I want to create a formula that incorporates two situations: 1) number of weekdays between Date Submitted and Date Completed when "Future Request" is unchecked or 2) number of weekdays between For Future Requests and Date Completed when "Future Request?" is checked.

Any help is much appreciated!

Tags:

Best Answers

  • Genevieve P.
    Genevieve P. Employee
    edited 11/03/21 Answer ✓

    Hi @Brooks

    Try this:

    =IF([Future Request]@row = 0, IF(Status@row <> "Complete", NETWORKDAYS([Date Submitted]@row, TODAY()), NETWORKDAYS([Date Submitted]@row, [Date Completed]@row)), IF(Status@row <> "Complete", NETWORKDAYS([For Future Requests]@row, TODAY()), NETWORKDAYS([For Future Requests]@row, [Date Completed]@row))


    It repeats your same formula... once for if the checkbox is 0, or un-checked, and then again if the checkbox is 1, but swapping out [Date Submitted]@row for [For Future Requests]@row .

    Let me know if this works for you!

    Cheers,

    Genevieve

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

  • Genevieve P.
    Genevieve P. Employee
    Answer ✓

    No problem! You can just add another statement right at the front:

    =IF(Progress@row <> "Future Request", IF([Future Request]@row = 0, IF(Status@row <> "Complete", NETWORKDAYS([Date Submitted]@row, TODAY()), NETWORKDAYS([Date Submitted]@row, [Date Completed]@row)), IF(Status@row <> "Complete", NETWORKDAYS([For Future Requests]@row, TODAY()), NETWORKDAYS([For Future Requests]@row, [Date Completed]@row)), "")


    This will be Blank if it's a Future Request. Does this do what you would like it to?

    Cheers!

    Genevieve

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

Answers

  • Genevieve P.
    Genevieve P. Employee
    edited 11/03/21 Answer ✓

    Hi @Brooks

    Try this:

    =IF([Future Request]@row = 0, IF(Status@row <> "Complete", NETWORKDAYS([Date Submitted]@row, TODAY()), NETWORKDAYS([Date Submitted]@row, [Date Completed]@row)), IF(Status@row <> "Complete", NETWORKDAYS([For Future Requests]@row, TODAY()), NETWORKDAYS([For Future Requests]@row, [Date Completed]@row))


    It repeats your same formula... once for if the checkbox is 0, or un-checked, and then again if the checkbox is 1, but swapping out [Date Submitted]@row for [For Future Requests]@row .

    Let me know if this works for you!

    Cheers,

    Genevieve

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

  • Brooks
    Brooks ✭✭✭✭

    Hi @Genevieve P.,

    Is there a way to edit this formula so that the above formula only works if the Progress column does not display "Future Request"?

    Thanks for your assistance!

  • Genevieve P.
    Genevieve P. Employee
    Answer ✓

    No problem! You can just add another statement right at the front:

    =IF(Progress@row <> "Future Request", IF([Future Request]@row = 0, IF(Status@row <> "Complete", NETWORKDAYS([Date Submitted]@row, TODAY()), NETWORKDAYS([Date Submitted]@row, [Date Completed]@row)), IF(Status@row <> "Complete", NETWORKDAYS([For Future Requests]@row, TODAY()), NETWORKDAYS([For Future Requests]@row, [Date Completed]@row)), "")


    This will be Blank if it's a Future Request. Does this do what you would like it to?

    Cheers!

    Genevieve

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions

  • Brooks
    Brooks ✭✭✭✭
    edited 11/03/21

    Perfect, @Genevieve P. Thanks so much for your help! I am still getting to know IF clauses.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!