Formula not working

Viewing 4 reply threads
  • Author
    Posts
  • December 12, 2024 at 2:47 PM #51366

    Mike Guilbault
    Participant

    I have a calculated field and can’t seem to get the formula quite right. It’s to calculate if an order is overdue by establishing if the order has been out for greater than 7 days. If the date Received is filled in, it does not have to calculate and displays nothing “”, but if it’s been out over the 7 days, it’s supposed to display “OVERDUE”.

    IFNOTEMPTY([RECEIVED];””;(IF((TODAY()-[DATEOUT]>7);”OVERDUE”;””)))

    It works if I only use IF((TODAY()-[DATEOUT]>7);”OVERDUE”;””) – but then if the item is RECEIVED, and it’s over the 7 days, it’s still displaying the OVERDUE – and of course it isn’t.

    Any suggestions? the square [ ] brackets are only to indicate the fields used.

    December 13, 2024 at 12:32 AM #51374

    Brendan
    Keymaster

    What is the data type of the DATEOUT field? Also, the TODAY() function will return the number of seconds since January 1, 1960. If DATEOUT is a Date field, then it also returns the number of seconds since January 1, 1960 to the date specified in that field’s value.

    So you’re subtracting seconds. You’ll want to convert those units to days instead. Or just use the DAYS() function, which does that for you.

    IFNOTEMPTY([RECEIVED]; "" ; IF(DAYS(TODAY(); [DATEOUT]) > 7); "OVERDUE"; ""))

    December 13, 2024 at 9:08 AM #51379

    Mike Guilbault
    Participant

    Thanks… that makes sense.. but I must be missing something – Can I assume that spaces don’t make a difference?

    IFNOTEMPTY([RECEIVED]; “” ;IF(DAYS(TODAY(); [DATEOUT]) > 7; “OVERDUE”;””))

    Didn’t return anything. I closed the doc, reopened, and for some reason, the [RECEIVED] field was filled in with yesterday’s date, which makes sense that OVERDUE isn’t displayed – but why is it filling in? I delete the date, refresh, and it fills in again.

    I added a new test record with no RECEIVED date (and more than 7 days after the DATEOUT) but still no OVERDUE.

    December 13, 2024 at 1:46 PM #51382

    Brendan
    Keymaster

    Do you have the Result Type set to be Text? (sorry, haven’t had a chance to look at your file yet).

    December 13, 2024 at 1:50 PM #51384

    Mike Guilbault
    Participant

    Yes I do.

Viewing 4 reply threads

You must be logged in to reply to this topic.