First Nth Column Sums

peter8848

Board Regular
Joined
Oct 7, 2018
Messages
112
Hi All,


Just trying to get a formula in workbook A to get Month to date figures from the data below in workbook B, say I need to get the Apple figure up to May, so in workbook A i had May in the title cell A1 but in A2 i should use the formula to get the sum of $26. I tried sum(if but this can only add one column rather than multiple columns, also tried sum(offset but this does not work with the data in a different workbook data and lastly tried to concatenate sum formula from Range Column A to Nth Column dependence on the month but cannot get the sting into a formula even using indirect. Any better suggestion would be much appreciated. thanks for your help. Cheers, Peter




ABCDEFGHIJKLM
1JanFebMarAprMayJunJulAugSepOctNovDec
2Apple712106610621910
3Orange2942881032248
4Mango626530527596

<tbody>
</tbody>
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Can you edit Workbook B?

If so, an extra row with 1-12 instead of Jan, Feb etc would allow you to use SUMIF().
 
Upvote 0
Why wouldn't OFFSET work for you?

I got it to work with this:

=SUM(OFFSET('[Workbook B.xlsx]Sheet1'!$B$2,0,0,1,MATCH(A1,'[Workbook B.xlsx]Sheet1'!$B$1:$M$1,0)))
 
Upvote 0
Another option

Book1
AB
1May
2Apple26
Paste
Cell Formulas
RangeFormula
B2=SUMPRODUCT(([Book1]Sheet1!$A$2:$A$4=A2)*(MONTH([Book1]Sheet1!$B$1:$M$1&1)<=MONTH(B1&1)),[Book1]Sheet1!$B$2:$M$4)
 
Upvote 0
Hi Glove_Man,

Thanks for your reply.

It just i some post saying it will not work with external workbook while i could not work it out. Also could yours work in a range like what Flutt had? Just want to learn if possible and what does that ,0,0,1 stand for in "Sheet1'!$B$2,0,0,1"?

Cheers,

Peter
 
Upvote 0
Hi Fluff,

You are a champion and it works!!!!

Sorry just wondering what is that &1 before the two brackets stand for? thanks for your help again.

Cheers,

Peter
 
Upvote 0
You're welcome & thanks for the feedback
It enables xl to convert a text month such as Aug into a number (ie 8)
 
Upvote 0
Hi Fluff,

Sorry one more question please, if is possible to amend your formula a bit to get the average of these value instead of the sum?

Thanks in advance.

Peter
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top