Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-2796505%22%20slang%3D%22en-US%22%3EExcel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2796505%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20numbers%20in%20columns%20a%2C%20b%20%26amp%3B%20c.%26nbsp%3B%20In%20column%20d%20I%20have%20a%20formula%20that%20adds%20up%20the%20three%20numbers%20to%20the%20left.%26nbsp%3B%20I%20need%20to%20be%20able%20to%20insert%20a%20blank%20column%20at%20column%20D%2C%20insert%20a%20new%20number%20into%20column%20D%20and%20have%20the%20formula%20automatically%20adjust%20to%20add%20the%20three%20numbers%20to%20the%20left%20which%20will%20now%20be%20columns%20b%2C%20c%20%26amp%3B%20d.%26nbsp%3B%20Is%20there%20any%20way%20to%20do%20that%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2796505%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2796534%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2796534%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1170473%22%20target%3D%22_blank%22%3E%40Michael1957%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20D2%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DSUM(OFFSET(D2%2C0%2C-3%2C1%2C3))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eor%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DSUM(INDEX(2%3A2%2CCOLUMN()-3)%3AINDEX(2%3A2%2CCOLUMN()-1))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EFill%20down.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2796824%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2796824%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20worked!%26nbsp%3B%20Thank%20you%20thank%20you%20thank%20you!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have numbers in columns a, b & c.  In column d I have a formula that adds up the three numbers to the left.  I need to be able to insert a blank column at column D, insert a new number into column D and have the formula automatically adjust to add the three numbers to the left which will now be columns b, c & d.  Is there any way to do that?

9 Replies

@Michael1957 

In D2:

=SUM(OFFSET(D2,0,-3,1,3))

or

=SUM(INDEX(2:2,COLUMN()-3):INDEX(2:2,COLUMN()-1))

Fill down.

@Hans Vogelaar 

It worked!  Thank you thank you thank you!!!

One follow-up question - how would I write the formula if I want to do A1-A2+A3

@Michael1957 

In which cell do you want the formula? In A4?

No, in cell D1. So D1 adds A1, subtracts, b1, then adds C1. We need to be able to insert a blank column at D and have the formula which now appears in E1 automatically adjusted to add B1, subtract C2 and Add the new entry in D1. We'll be doing this every month always analyzing the last three months.

@Michael1957

I'm confused. You first mentioned A1-A2+A3, then A1-B1+C1 and finally something with B1 and C2.

Please explain.

Sorry Hans - I've been at this all day so I'm a bit fuzzy. It's A1-B1+C1 with the formula appearing in D1. We then insert a blank column at D and want the formula to automatically adjust to B1-C1+D1. The formula you first mentioned worked but only if adding all three cells. I'm not sure how to do it if I want to include subtracting a cell in the formula.

@Michael1957 

Thanks. That would be

=INDEX(2:2,COLUMN()-3)-INDEX(2:2,COLUMN()-2)+INDEX(2:2,COLUMN()-1)
Wow! That's some formula, but definitely doable. Thank you so much Hans! Much appreciated.