Using a Sum function within a IF function

%3CLINGO-SUB%20id%3D%22lingo-sub-957108%22%20slang%3D%22en-US%22%3EUsing%20a%20Sum%20function%20within%20a%20IF%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957108%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20I%20have%20possibly%20a%20simple%20question.%26nbsp%3B%20I%20have%20developed%20a%20%3DIF%20that%20contains%20a%20SUM%20function.%26nbsp%3B%20when%20I%20attempt%20to%20copy%20it%20down%20my%20spreadsheet%2C%20the%20cells%20in%20the%20SUM%20statement%20become%20absolute%20I%20would%20like%20them%20to%20adjust%20to%20the%20new%20corresponding%20cells%20as%20I%20copy%20down.%26nbsp%3B%20What%20do%20I%20do.%26nbsp%3B%20Here%20is%20the%20Function%3C%2FP%3E%3CP%3E%3DIF(E65*G65%26lt%3B0%2CSUM((((ABS(G67*100)*ABS(E67))))%2B(((100*M67)*K67)%2B((100*Q67)*O67)%2B((100*U67*S67))%2B((100*Y67)*W67)))%2C%22ea%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20E65*G65%20adjust%20accordingly%20during%20the%20copy%20and%20paste%20the%20rest%20do%20not.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThankyou%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-957108%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E%3DIF%20function%20copying%20problems%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957482%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20a%20Sum%20function%20within%20a%20IF%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957482%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F434058%22%20target%3D%22_blank%22%3E%40Hopgrower%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEntered%20your%20formula%20in%20a%20new%20workbook%20and%20copied%20it%20down%20a%20few%20rows.%20None%20of%20the%20cell%20references%20became%20absolute%20for%20me.%20Perhaps%20you%20can%20upload%20your%20workbook%20to%20demonstrate%20the%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20you%20may%20want%20to%20make%20your%20formula%20a%20bit%20easier%20to%20read%20and%20maintain.%20The%20SUM%20statement%20is%20not%20needed%20and%20it%20will%20reduce%20the%20number%20of%26nbsp%3B%3CSPAN%3Ebrackets.%26nbsp%3B%3C%2FSPAN%3EI%20think%20this%20one%20will%20achieve%20the%20same%20result%20(with%20row%201%20as%20the%20base%20in%20stead%20of%2065%20in%20your%20example)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(E1*G1%26lt%3B0%2CABS(G3*100)*ABS(E3)%2B100*M3*K3%2B100*Q3*O3%2B100*U3*S3%2B100*Y3*W3%2C%22ea%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957522%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20a%20Sum%20function%20within%20a%20IF%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957522%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F434058%22%20target%3D%22_blank%22%3E%40Hopgrower%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20should%20work%2C%26nbsp%3B%20are%20you%20just%20using%20Copy%20Paste%20(Ctrl%20C%2C%26nbsp%3B%20Ctrl%20V)%20%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-958066%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20a%20Sum%20function%20within%20a%20IF%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-958066%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F434058%22%20target%3D%22_blank%22%3E%40Hopgrower%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20guess%20your%20formula%20could%20be%20simplified%20to%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIF(E65*G65%26lt%3B0%2C100*(ABS(G67*E67)%2BM67*K67%2BQ67*O67%2BU67*S67%2BY67*W67)%2C%22ea%22)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eif%20copy%2Fpaste%20one%20row%20down%20it%20will%20be%20as%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIF(E66*G66%26lt%3B0%2C100*(ABS(G68*E68)%2BM68*K68%2BQ68*O68%2BU68*S68%2BY68*W68)%2C%22ea%22)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eif%20that's%20what%20do%20you%20mean.%20Your%20initial%20formula%20with%20SUM%20shall%20return%20exactly%20the%20same%20result.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957480%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20a%20Sum%20function%20within%20a%20IF%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957480%22%20slang%3D%22en-US%22%3EEntered%20your%20formula%20in%20a%20new%20sheet%20and%20pasted%20it%20down%20a%20few%20cells.%20None%20of%20the%20cell%20references%20became%20absolute.%20Please%20upload%20a%20workbook%20that%20demonstrates%20your%20problem.%3CBR%20%2F%3E%3CBR%20%2F%3EBy%20the%20way%2C%20your%20formula%20has%20an%20awful%20lot%20of%20((()))%20and%20a%20sum%20function%20that%20is%20not%20needed.%20Try%20this%20one%20(written%20with%20row%201%20as%20the%20base%20row%2C%20i.e.%20not%2065)%3A%3CBR%20%2F%3E%3DIF(E1*G1%26lt%3B0%2CABS(G3*100)*ABS(E3)%2B(100*M3*K3)%2B(100*Q3*O3)%2B(100*U3*S3)%2B(100*Y3*W3)%2C%22ea%22)%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Hello, I have possibly a simple question.  I have developed a =IF that contains a SUM function.  when I attempt to copy it down my spreadsheet, the cells in the SUM statement become absolute I would like them to adjust to the new corresponding cells as I copy down.  What do I do.  Here is the Function

=IF(E65*G65<0,SUM((((ABS(G67*100)*ABS(E67))))+(((100*M67)*K67)+((100*Q67)*O67)+((100*U67*S67))+((100*Y67)*W67))),"ea")

 

The E65*G65 adjust accordingly during the copy and paste the rest do not.

 

Thankyou

3 Replies
Highlighted

@Hopgrower 

Entered your formula in a new workbook and copied it down a few rows. None of the cell references became absolute for me. Perhaps you can upload your workbook to demonstrate the problem.

 

By the way, you may want to make your formula a bit easier to read and maintain. The SUM statement is not needed and it will reduce the number of brackets. I think this one will achieve the same result (with row 1 as the base in stead of 65 in your example);

 

=IF(E1*G1<0,ABS(G3*100)*ABS(E3)+100*M3*K3+100*Q3*O3+100*U3*S3+100*Y3*W3,"ea")

 

 

Highlighted

@Hopgrower 

 

It should work,  are you just using Copy Paste (Ctrl C,  Ctrl V) ?

 

@Hopgrower 

I guess your formula could be simplified to

=IF(E65*G65<0,100*(ABS(G67*E67)+M67*K67+Q67*O67+U67*S67+Y67*W67),"ea")

if copy/paste one row down it will be as

=IF(E66*G66<0,100*(ABS(G68*E68)+M68*K68+Q68*O68+U68*S68+Y68*W68),"ea")

if that's what do you mean. Your initial formula with SUM shall return exactly the same result.