Hyperformula with Dates and checkbox IF statement

Tags: #<Tag:0x00007efc62536028>

Hello everyone
I’m trying to put a formula using Hyperfomula with an IF statement to calculate days difference between columns/variable but I’m not able to make it work. So if the column “c” is checked it calculates number of days between columns B and A, if it is unchecked is number of days between today and column A as per this example the 2nd row, does not work when checking/unchecking column C: https://jsfiddle.net/jamblock/yp1af98n/2/.
What is the right syntax to make the if statement work with a checkbox/bool/logical expression ?

Hi @adonisbriceno

Please find the updated demo attached https://jsfiddle.net/grw03hpe/2/

The C2 itself is considered true, it means that we should change

'=IF(C2="TRUE",b2-a2,d2-a2)'

to

'=IF(C2,b2-a2,d2-a2)'

Also, the formula itself does not update so I have attached an afterChange call to trigger that change. I will investigate the subject and check why it does not update instantly as I should.

1 Like

It seems that the C2="TRUE" was blocking the update. With C2 it should work well.
Please confirm if it works as well in your project.

Yes Alek,… it does thank you very much

1 Like