# From excel function to Math formula

Dear all

I want to convert the following excel formula into the ‘math formula’ in knime but it seems a bit difficult to understand

Can someone help me do this?

=IF(AND(G6=“Aflyst af patient”; U6<6 );“Udeblevet”;“Annulleret”)

Thank you

Christopher Gyldenkærne

Hej @stoffer88

The Rule Engine nolde is the better choice for this kind of operation.

I don’t really use excel, but I hope i got it right in the attached example workflow.

excel_to_rule_engine.knwf (3.6 KB)

I hope it helps!

1 Like

Thank you @oole! you’re an angel. I will try this right away

Additionally, you can use a Java Snippet (Simple) to do this:

``````if (\$G\$.equals("Aflyst af patient") && Integer.valueOf(\$U\$) < 6) {
return "Udeblevet";
} else {

return "Annulleret";
}``````

Dear all,

I am able to understand the above conversion of excel function to Knime math formula. However, I am having trouble in converting the following formula:
=IF(COUNTIF(\$F\$2:\$F\$61706,F2)=1,FALSE,NOT(COUNTIF(\$F\$2:F2,F2)=1))
This formula returns false if a string occurs first time in a column (here column F) and true if the string occurs second time. Cells with False are unique strings.

Maybe I’m mistaken but not sure how this formula can return TRUE unless column is empty 