Forum

Using CELL and OFFS...
 
Notifications
Clear all

Using CELL and OFFSET to find an address then using it in a SUM range

5 Posts
3 Users
0 Reactions
94 Views
(@mlinke)
Posts: 39
Trusted Member
Topic starter
 

Hi

I have a table of data, which is the annual budget by month for each account in the accounting system. The format is:

Account Name, Jan, Feb, Mar, Apr, etc.

Each month's report needs to pull a YTD amount for each account by summing from Jan to that month. I'm working on April, so in this case Jan to Apr.

So that I don't need to update the formula to extend the range each month I want to create a formula to find the current end month.

From the dates I have on the data page I've pulled the month number using the MONTH function and put it in a cell named MonthNo.

My formula to sum the YTD budget is (I've tried with and without the quotes around the first cell reference):

=SUM("C201:"&CELL("address",OFFSET(B201,0,MonthNo)))

But that returns a #VALUE error. Evaluating the CELL part give me that error, however, if I use that by itself I get a cell address ($F$201), which is the correct cell for the sum.

If I use the formula

=SUM(C201:F201)

I get the correct result. But that means I need to update the formula each month.

How can I get this to work?

Thanks

Mardi

 
Posted : 29/05/2020 9:07 pm
Philip Treacy
(@philipt)
Posts: 1632
Member Admin
 

Hi Mardi,

Please supply the workbook.

Regards

Phil

 
Posted : 29/05/2020 10:05 pm
(@mlinke)
Posts: 39
Trusted Member
Topic starter
 

Hi Phil

Can I email it to you? I don't want to put it on a public forum.

Thanks

Mardi

 
Posted : 29/05/2020 11:22 pm
(@mynda)
Posts: 4762
Member Admin
 

Hi Mardi,

You don't need the CELL function. Please refer to session 3.15 for OFFSET from the 2019/365 course. If you're still stuck, then email us your file with your attempt without CELL so we can see why it's still not working.

Mynda

 
Posted : 30/05/2020 12:50 am
(@mlinke)
Posts: 39
Trusted Member
Topic starter
 

Lovely, worked perfectly once I watched 3.15 (again).Laugh

 
Posted : 30/05/2020 1:14 am
Share: