Copy a value from another column not working (within IF Function)


  • When Im using this formula:

    =IF(ISBLANK([Date Sent]),"<img src='/_layouts/images/blank.gif' onload=""{"&"    var SPday=new Date();"&"    SPday.setFullYear("&YEAR([Date Of Request])&","&MONTH([Date Of Request])-1&","&DAY([Date Of  Request])&");"&"    var Days=Math.round((SPday.getTime()-new Date().getTime())/86400000);"&"    this.parentNode.innerHTML=Math.abs(Days)+' days '+((Days<0)?'past':'left');"&"}"">","=[Days taken]")

    [Days taken] is a column which I calculate: [Date Sent] - [Date Of Request]

    If above is true, it will calculate the date accordingly, but when it's false, it shows the text "=[Days taken]".

    I want it to show the number instead of the text. Please help! thanks!


    • Edited by Rijia Friday, March 15, 2019 4:57 AM
    Friday, March 15, 2019 4:56 AM

All replies

  • Hi Rijia,

    You can change "=[Days taken]" to [Days taken] and check again.

    Best regards,

    Grace Wang

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, March 15, 2019 8:47 AM