Home

IF function help on a simple formula

%3CLINGO-SUB%20id%3D%22lingo-sub-783415%22%20slang%3D%22en-US%22%3EIF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783415%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20there%2C%20i%20am%20looking%20for%20help%20on%20a%20very%20basic%20formula%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECell%20C1%20%3D%20If%20cell%20A1%20and%2For%20cell%20B1%20is%20blank%2C%20then%20return%20blank%2C%20otherwise%20return%20the%20result%20of%20Cell%20B%20minus%20Cell%20A.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20multiple%20options%20but%20don't%20get%20the%20preferred%20answer.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-783415%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783443%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783443%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F385495%22%20target%3D%22_blank%22%3E%40Tian77%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20could%20be%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-ruby%22%3E%3CCODE%3E%3DIF((LEN(A1)%2BLEN(B1))*LEN(B1)%2CB1-A1%2C%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783463%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783463%22%20slang%3D%22en-US%22%3EHi%20Sergei%2C%20i%20copied%20your%20formula%2C%20however%20am%20still%20getting%20a%20error%3A%20%22not%20trying%20to%20type%20a%20formula%22%20%2C%20excel%20thinks%20i%20am%20trying%20to%20type%20a%20statement.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783513%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783513%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F385495%22%20target%3D%22_blank%22%3E%40Tian77%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20check%20the%20formula%20in%20attached%20file%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783519%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783519%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F385495%22%20target%3D%22_blank%22%3E%40Tian77%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20this%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DIF((A1%3D%22%22)%2B(B1%3D%22%22)%2C%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%22%22%2C%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EB1-A1)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783796%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783796%22%20slang%3D%22en-US%22%3EGreat%2C%20thanks%20Twifoo%2C%20this%20works%20!%20Much%20appreciated%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-783798%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-783798%22%20slang%3D%22en-US%22%3EThanks%20Sergei%2C%20the%20formula%20posted%20by%20Twifoo%20fits%20my%20condition%20on%20the%20file.%20Thanks%20for%20the%20help%20!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-784117%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20help%20on%20a%20simple%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-784117%22%20slang%3D%22en-US%22%3EYour%20appreciation%20is%20my%20delight!%3C%2FLINGO-BODY%3E
Tian77
New Contributor

Hi there, i am looking for help on a very basic formula:

 

Cell C1 = If cell A1 and/or cell B1 is blank, then return blank, otherwise return the result of Cell B minus Cell A.

 

I have tried multiple options but don't get the preferred answer.

7 Replies

@Tian77 

It could be

=IF((LEN(A1)+LEN(B1))*LEN(B1),B1-A1,"")
Hi Sergei, i copied your formula, however am still getting a error: "not trying to type a formula" , excel thinks i am trying to type a statement.

@Tian77 

Please check the formula in attached file

Highlighted

@Tian77 

Try this: 

=IF((A1="")+(B1=""),

"",

B1-A1)

Great, thanks Twifoo, this works ! Much appreciated
Thanks Sergei, the formula posted by Twifoo fits my condition on the file. Thanks for the help !
Your appreciation is my delight!
Related Conversations
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies