I can't use a specific datatype with this function

%3CLINGO-SUB%20id%3D%22lingo-sub-1622327%22%20slang%3D%22en-US%22%3EI%20can't%20use%20a%20specific%20datatype%20with%20this%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622327%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20running%20a%20swedish%20version%2C%20and%20am%20trying%20to%20display%20with%20the%20function%20IF%20a%20result%20from%20a%20basic%20formula%20or%20I%20want%20the%20result%20to%20be%200.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20cells%20are%20already%20changed%20to%20numbers%2Fint%20(tal%20in%20swedish)%20but%20the%20function%20will%20only%20work%20if%20I%20use%20the%20result%20in%20text%2Fstring%2C%20but%20then%20it%20will%20just%20display%20the%20formula%2C%20not%20the%20result%20itself%20ofcourse.%3C%2FP%3E%3CP%3EWhere%20is%20the%20function%20wrong%3F%20I%20might%20have%20been%20meesed%20up%20the%20parenteses%20a%20bit%2C%20or%20is%20it%20another%20little%20thing%20I%20missed%3F%3C%2FP%3E%3CP%3EI%20will%20post%20the%20functionas%20it%20is%20written%2C%20and%20a%20%22translated%22%20version%20below%20if%20there%20is%20anyone%20out%20there%20having%20the%20urge%20to%20help%20me%20%3CLI-EMOJI%20id%3D%22lia_winking-face%22%20title%3D%22%3Awinking_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DOM(OCH((J2%26lt%3B(2020-C2))%3B(K2%26gt%3B(2020-C2)))%3B(B2*(1%2F(2020-C2)%3B0)%3C%2FP%3E%3CP%3E%3DIF(AND((J2%26lt%3B(2020-C2))%3B(K2%26gt%3B(2020-C2)))%3B(B2*(1%2F(2020-C2)%3B0)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1622327%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622336%22%20slang%3D%22en-US%22%3ERe%3A%20I%20can't%20use%20a%20specific%20datatype%20with%20this%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622336%22%20slang%3D%22en-US%22%3EUpdate%3CBR%20%2F%3EProblem%20solved!%3CBR%20%2F%3E%3CBR%20%2F%3EI%20found%20the%20problem%20(ofcourse)%20when%20I%20tried%20to%20llok%20deeper%20in%20to%20the%20parenteses.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20formula%20now%20works%20and%20looks%20like%20this%3CBR%20%2F%3E%3CBR%20%2F%3E%3DOM(OCH((J2%26lt%3B(2020-C2))%3B(K2%26gt%3B(2020-C2)))%3B(B2*(1%2F(2020-C2)))%3B0)%3CBR%20%2F%3E%3DIF(AND((J2%26lt%3B(2020-C2))%3B(K2%26gt%3B(2020-C2)))%3B(B2*(1%2F(2020-C2)))%3B0)%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622589%22%20slang%3D%22en-US%22%3ERe%3A%20I%20can't%20use%20a%20specific%20datatype%20with%20this%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622589%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F776576%22%20target%3D%22_blank%22%3E%40mrdopz%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20have%20lot%20of%20extra%20parentheses%20which%20actually%20are%20not%20needed%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIF(AND(%20J2%26lt%3B(2020-C2)%3BK2%26gt%3B(2020-C2)%20)%3B%20B2*1%2F(2020-C2)%3B0)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622953%22%20slang%3D%22en-US%22%3ERe%3A%20I%20can't%20use%20a%20specific%20datatype%20with%20this%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622953%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20pointing%20that%20out%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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