I can't use a specific datatype with this function

Copper Contributor

I am running a swedish version, and am trying to display with the function IF a result from a basic formula or I want the result to be 0.

 

The cells are already changed to numbers/int (tal in swedish) but the function will only work if I use the result in text/string, but then it will just display the formula, not the result itself ofcourse.

Where is the function wrong? I might have been meesed up the parenteses a bit, or is it another little thing I missed?

I will post the functionas it is written, and a "translated" version below if there is anyone out there having the urge to help me ;)

 

=OM(OCH((J2<(2020-C2));(K2>(2020-C2)));(B2*(1/(2020-C2);0)

=IF(AND((J2<(2020-C2));(K2>(2020-C2)));(B2*(1/(2020-C2);0)

3 Replies
Update
Problem solved!

I found the problem (ofcourse) when I tried to llok deeper in to the parenteses.

The formula now works and looks like this

=OM(OCH((J2<(2020-C2));(K2>(2020-C2)));(B2*(1/(2020-C2)));0)
=IF(AND((J2<(2020-C2));(K2>(2020-C2)));(B2*(1/(2020-C2)));0)

@mrdopz 

You have lot of extra parentheses which actually are not needed

=IF(AND( J2<(2020-C2);K2>(2020-C2) ); B2*1/(2020-C2);0)

Thanks for pointing that out @Sergei Baklan  :)