SOLVED

How to use the Subtract with IF function ?

%3CLINGO-SUB%20id%3D%22lingo-sub-306974%22%20slang%3D%22en-US%22%3EHow%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-306974%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EActually%2C%20I%20need%20some%20help%20about%20How%20I%20can%20use%20subtract%20with%20IF%20function%20Or%20any%20other%20way%20%3F%3C%2FP%3E%3CP%3EFor%20example%3A%20If%20A%26gt%3B0%20%2C%20make%20(B%20-%20C).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20I%20can%20use%20it%20on%20Excel%2C%20Please%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%3CLINGO-LABS%20id%3D%22lingo-labs-306974%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-307537%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307537%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20open%20my%20profile%20here%20and%20send%20me%20a%20private%20message.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307529%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307529%22%20slang%3D%22en-US%22%3E%3CP%3ECan%20I%20talk%20to%20you%20in%20any%20app%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307472%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307472%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20you%20can%20do%20this%20by%20using%20OR%20function%20as%20follows%3A%3C%2FP%3E%3CPRE%3E%3DIF(OR(D6%26gt%3B0%2CD9%26gt%3B0)%2C0%2C10000)%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20above%20formula%20says%3A%3C%2FP%3E%3CP%3EIf%20either%20cell%20D6%20or%20cell%20D9%20is%20greater%20than%200%2C%20then%20return%200%2C%20otherwise%2C%20show%20the%20AV%20Balance%20which%20is%2010000.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20you%20can%20replace%20OR%20with%20AND%20function%20to%20check%20if%20both%20cells%20are%20greater%20than%200.%3C%2FP%3E%3CP%3EThe%20difference%20is%20that%20AND%20requires%20both%20cells%20to%20be%20greater%20than%200%20in%20order%20to%20return%200.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EHaytham%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307459%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307459%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20sorry%20my%20friend%2C%20I%20want%20to%20ask%20you%2C%20please%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%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3DIF(D6%26gt%3B0%2C0%2C10000)%3C%2FPRE%3E%3CP%3ECan%20I%20add%20other%20same%20cell%20in%20this%26nbsp%3B%3CSPAN%3Efunction%20%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307419%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307419%22%20slang%3D%22en-US%22%3E%3CP%3EThat%20is%20right%2C%20great.%3C%2FP%3E%3CP%3EThank%20you%20so%20much%20Mr.Amairah.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20Regards%3C%2FP%3E%3CP%3EHAITHAM%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307173%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307173%22%20slang%3D%22en-US%22%3E%3CP%3EOkay%2C%20I've%20updated%20the%20workbook%20with%20this%20formula%20in%20AV%20Balance%20cell.%3C%2FP%3E%3CPRE%3E%3DIF(D6%26gt%3B0%2C0%2C10000)%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20want%20to%20change%20the%20AV%20Balance%2C%20you%20can%20change%20it%20in%20the%20formula%20from%2010000%20to%20something%20else.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20this%20helps%20you%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-307147%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307147%22%20slang%3D%22en-US%22%3E%3CP%3EDon't%20worry%20my%20brother.%26nbsp%3B%3C%2FP%3E%3CP%3ENow%2C%20I%20hope%20to%20understand%20me%20Lol%3C%2FP%3E%3CP%3EI%20put%20example%20down%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%3CLINGO-SUB%20id%3D%22lingo-sub-307078%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-307078%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20for%20the%20late%20reply%2C%20but%20I%20didn't%20understand%20what%20you%20need!%3C%2FP%3E%3CP%3EPlease%20tell%20me%20what%20the%20wrong%20in%20the%20formula%20or%20give%20me%20examples%20on%20some%20cases%20and%20what%20the%20formula%20should%20return%20in%20them%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-306984%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-306984%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirstly%2C%20thank%20you%20for%20help%20my%20brother%20%3A).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20check%20your%20file%20to%20fine%20What%20I%20need%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHAITHAM%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%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-306977%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-306977%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20show%20you%20a%20simple%20example%20as%20follows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3DIF(A2%26gt%3B0%2CB2-C2%2CA2)%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20634px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F64268i796F4D0E7B266008%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22IF%20function%20(Simple%20Example).png%22%20title%3D%22IF%20function%20(Simple%20Example).png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20above%20formula%20says%3A%3C%2FP%3E%3CP%3EIF%20cell%20A2%20greater%20than%200%2C%20then%20subtract%20cell%20C2%20from%20B2%20and%20return%20the%20result.%3C%2FP%3E%3CP%3EOtherwise%2C%20return%20the%20value%20of%20cell%20A2%20as%20it%20is.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20check%20out%20this%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fif-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Elink%3C%2FA%3Eto%20learn%20more%20about%20IF%20function.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2116255%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2116255%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDear%20Sir%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BCan%20I%20use%20multi-cell%20for%20calculation%3F%3C%2FP%3E%3CP%3EFor%20Example%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20A2%3D1.1%20and%20C2%3D3%20and%20D2%3DA%20and%20If%20Sum%20of%20L2%20TO%20T2%20%26gt%3B%2040-F2-H2%20Then%20Sum%20of%20L2%20To%20R2%20and%20if%20Sum%20Of%20L2%20TO%20R2%20%26gt%3B%2040-F2-H2%20then%20answae%20L2%20To%20P2%20otherwise%20sum%20of%20L2%20TO%20N2%3C%2FP%3E%3CP%3EAlso%20Sheet%20are%20Attached%3C%2FP%3E%3CP%3Eplease%20help%20me%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2116316%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2116316%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F957522%22%20target%3D%22_blank%22%3E%40Abdul_Naveed192000%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20is%20the%20duplication%20of%20the%20question%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fexcel-working%2Fm-p%2F2116269%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel%2Fexcel-working%2Fm-p%2F2116269%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2300589%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2300589%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3ECan%20you%20help%20me%20with%20this%20one.%3CBR%20%2F%3E%3CBR%20%2F%3EIF(A2%3CB2%3E%3C%2FB2%3EIF(A2%26gt%3B%3DB2%2C%220%22).%20The%20result%20says%20I%20already%20exceed%202%20to%203%20arguments.%3CBR%20%2F%3ECan%20you%20help%20me%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2301568%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20the%20Subtract%20with%20IF%20function%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2301568%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1039075%22%20target%3D%22_blank%22%3E%40Tops_dc%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20is%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3EIF(A2%3CB2%3E%3C%2FB2%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi everyone,

 

Actually, I need some help about How I can use subtract with IF function Or any other way ?

For example: If A>0 , make (B - C).

 

How I can use it on Excel, Please :)

14 Replies

Hi,

 

Let me show you a simple example as follows.

 

=IF(A2>0,B2-C2,A2)

 IF function (Simple Example).png

 

The above formula says:

IF cell A2 greater than 0, then subtract cell C2 from B2 and return the result.

Otherwise, return the value of cell A2 as it is.

 

Please check out this link to learn more about IF function.

 

Hope that helps

 

Firstly, thank you for help my brother :).

 

Please check your file to fine What I need ?

 

Thank you again.

 

HAITHAM :)

 

Hi,

 

Sorry for the late reply, but I didn't understand what you need!

Please tell me what the wrong in the formula or give me examples on some cases and what the formula should return in them?

 

Don't worry my brother. 

Now, I hope to understand me Lol

I put example down :)

best response confirmed by CEOBlockchain (Occasional Contributor)
Solution

Okay, I've updated the workbook with this formula in AV Balance cell.

=IF(D6>0,0,10000)

 

If you want to change the AV Balance, you can change it in the formula from 10000 to something else.

 

I hope this helps you

Regards

That is right, great.

Thank you so much Mr.Amairah. 

 

Best Regards

HAITHAM

I'm sorry my friend, I want to ask you, please :)

 

=IF(D6>0,0,10000)

Can I add other same cell in this function ?

Hi,

 

Yes, you can do this by using OR function as follows:

=IF(OR(D6>0,D9>0),0,10000)

 

The above formula says:

If either cell D6 or cell D9 is greater than 0, then return 0, otherwise, show the AV Balance which is 10000.

 

Also, you can replace OR with AND function to check if both cells are greater than 0.

The difference is that AND requires both cells to be greater than 0 in order to return 0.

 

Regards,

Haytham

Can I talk to you in any app ?

You can open my profile here and send me a private message.

@Haytham Amairah 

Dear Sir,

 

           Can I use multi-cell for calculation?

For Example 

if A2=1.1 and C2=3 and D2=A and If Sum of L2 TO T2 > 40-F2-H2 Then Sum of L2 To R2 and if Sum Of L2 TO R2 > 40-F2-H2 then answae L2 To P2 otherwise sum of L2 TO N2

Also Sheet are Attached

please help me

Hi,
Can you help me with this one.

IF(A2<B2, A2-B2,A2) this one works but I want to add this next function
IF(A2>=B2,"0"). The result says I already exceed 2 to 3 arguments.
Can you help me?

@Tops_dc 

That is

IF(A2<B2, A2-B2,0) 

or

=MAX(A2-B2,0)