Home

Help - Formula works in one sheet but not another?

%3CLINGO-SUB%20id%3D%22lingo-sub-931478%22%20slang%3D%22en-US%22%3EHelp%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-931478%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20formula%20which%20works%20great%20in%20one%20sheet%20but%20not%20in%20any%20other%20sheets%20within%20the%20same%20workbook.%20I%20have%20tried%20both%20copy%20and%20pasting%20into%20a%20new%20sheet%20and%20retyping%20the%20formula.%20The%20formula%20is%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3E%3DSUM(IF(MOD(COLUMN(F5%3ACM5)%2C3)%3D0%2CF5%3ACM5%2C0))%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20first%20sheet%20it%20returns%20the%20sum%20total%20of%20the%20values%20in%20every%20third%20column%20in%20the%20range%20F5%20to%20CM5.%20In%20all%20other%20sheets%20it%20returns%200.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%3F%20Thanks%20a%20million%20in%20advance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-931478%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-933700%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-933700%22%20slang%3D%22en-US%22%3EThis%20is%20an%20array%20formula%2C%20which%20must%20be%20entered%20using%20control%2Bshift%2BEnter%20rather%20than%20just%20Enter.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-933875%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-933875%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F431458%22%20target%3D%22_blank%22%3E%40lauraIBT%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F22322%22%20target%3D%22_blank%22%3E%40Jan%20Karel%20Pieterse%3C%2FA%3E%20mentioned%2C%20it%20is%20an%20Array%20Formula%20which%20requires%20confirmation%20with%20Ctrl%2BShift%2BEnter%20instead%20of%20Enter%20alone.%20That's%20because%20SUM%20function%20cannot%20handle%20arrays.%3C%2FP%3E%3CP%3EBut%20you%20can%20use%20SUMPRODUCT%20which%20can%20handle%20arrays%20and%20you%20can%20confirm%20it%20with%20Enter%20only.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DSUMPRODUCT((MOD(COLUMN(F5%3ACM5)%2C3)%3D0)*F5%3ACM5)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957884%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957884%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F22322%22%20target%3D%22_blank%22%3E%40Jan%20Karel%20Pieterse%3C%2FA%3Ethank%20you%20for%20the%20reply%2C%20but%20this%20hasn't%20helped%2C%20it%20still%20returns%20zero%20and%20in%20the%20first%20sheet%20where%20it%20does%20work%20I%20only%20used%20Enter.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957895%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957895%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20reply%20but%20this%20hasn't%20made%20a%20difference%2C%20your%20formula%20works%20perfectly%20in%20the%20first%20sheet%20but%20will%20only%20return%200%20in%20all%20other%20sheets%20in%20the%20workbook.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20this%20might%20be%20a%20problem%20with%20the%20sheet%20setting%20rather%20than%20the%20formulas%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-958017%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-958017%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F431458%22%20target%3D%22_blank%22%3E%40lauraIBT%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20may%20try%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DSUM(IF(MOD(COLUMN(F5%3ACM5)%2C3)%3D0%2C--F5%3ACM5%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eor%20better%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DSUMPRODUCT(IF(MOD(COLUMN(F5%3ACM5)%2C3)%3D0%2C--F5%3ACM5%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-958020%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-958020%22%20slang%3D%22en-US%22%3E%3CP%3E%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%3C%2FP%3E%3CP%3EThank%20you%20but%20still%20no%20change%2C%20returns%200%20in%20all%20other%20sheets%20but%20the%20first.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-958082%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-958082%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F431458%22%20target%3D%22_blank%22%3E%40lauraIBT%3C%2FA%3E%20%2C%20if%20you%20simply%20enter%20%3DSUM(F5)%20in%20any%20empty%20cell%20of%20the%20first%20sheet%2C%20and%20the%20same%20into%20the%20empty%20cell%20of%20the%20second%20sheet%2C%20what%20do%20they%20return%3F%20Assuming%20F5%20is%20not%20empty%20in%20both%20sheets.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-958092%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-958092%22%20slang%3D%22en-US%22%3EThey%20return%20the%20value%20of%20F5%20(ie%20-300)%20in%20all%20sheets.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-958258%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20-%20Formula%20works%20in%20one%20sheet%20but%20not%20another%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-958258%22%20slang%3D%22en-US%22%3ECan%20you%20please%20post%20a%20sample%20workbook%20which%20contains%20just%20one%20sheet%20that%20gives%20the%20zeroes%3F%20Please%20make%20sure%20you%20remove%20snesitive%20information%20first.%3C%2FLINGO-BODY%3E
lauraIBT
Occasional Contributor

I have a formula which works great in one sheet but not in any other sheets within the same workbook. I have tried both copy and pasting into a new sheet and retyping the formula. The formula is

 

=SUM(IF(MOD(COLUMN(F5:CM5),3)=0,F5:CM5,0))

 

In the first sheet it returns the sum total of the values in every third column in the range F5 to CM5. In all other sheets it returns 0. 

 

Any ideas? Thanks a million in advance.

 

9 Replies
This is an array formula, which must be entered using control+shift+Enter rather than just Enter.
Highlighted

@lauraIBT 

As @Jan Karel Pieterse mentioned, it is an Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone. That's because SUM function cannot handle arrays.

But you can use SUMPRODUCT which can handle arrays and you can confirm it with Enter only.

 

=SUMPRODUCT((MOD(COLUMN(F5:CM5),3)=0)*F5:CM5)

@Jan Karel Pietersethank you for the reply, but this hasn't helped, it still returns zero and in the first sheet where it does work I only used Enter.

@Subodh_Tiwari_sktneer

Thank you for your reply but this hasn't made a difference, your formula works perfectly in the first sheet but will only return 0 in all other sheets in the workbook. 

 

I think this might be a problem with the sheet setting rather than the formulas 

@lauraIBT 

You may try

=SUM(IF(MOD(COLUMN(F5:CM5),3)=0,--F5:CM5,0))

or better

=SUMPRODUCT(IF(MOD(COLUMN(F5:CM5),3)=0,--F5:CM5,0))

@Sergei Baklan 

Thank you but still no change, returns 0 in all other sheets but the first.

@lauraIBT , if you simply enter =SUM(F5) in any empty cell of the first sheet, and the same into the empty cell of the second sheet, what do they return? Assuming F5 is not empty in both sheets.

They return the value of F5 (ie -300) in all sheets.
Can you please post a sample workbook which contains just one sheet that gives the zeroes? Please make sure you remove snesitive information first.
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies