dynamic SUM

cata2200

Board Regular
Joined
Jul 29, 2006
Messages
60
Hello

I have 31 columns in a row as days of the actual month.
How I can sum the first 'n' columns in the row, where 'n'=today()-1?

Many thanks for tip.

Catalin
 
Last edited:

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
How big is your range?
By the !31 columns" do you mean one cel in a column or literraly a whole 31 columns?
Do you want to count those days I assume not sum?
 
Upvote 0
Robert
Nope. I have a list with the first column as 'Trade', second as 'Numbers' and rest of 31 as hours during each day of the month, regardless of Feb, Apr, Jun, etc.
On the 34th column I need to have the sum value of all cells in the row, from day 1 to 'today()-1'.
 
Last edited:
Upvote 0
Robert
Nope. I have a list with the first column as 'Trade', second as 'Numbers' and rest of 31 as hours during each day of the month, regardless of Feb, Apr, Jun, etc.
On the 34th column I need to have the sum value of all cells in the row, from day 1 to 'today()-1'.

What is the exact range for the first data record including the trade value?
 
Upvote 0
I need to apologize, but I done the work.
The formula is:
=SUM(INDIRECT(CONCATENATE(ADDRESS(ROW(), 30), ":", ADDRESS(ROW(), 30+DAY($B$3)-3))))
Sorry for keeping you busy, but, after a cigarette and a coffee, far away from computer, I could manage to “invent” this formula.
What is doing: is summing all values, from day 1 of the month up to 2 days before ‘today()’.
The reporting date is entered in $B$3.
I suppose to post a sample, but it will take time to learn this facility.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Many thanks once again for support.
 
Upvote 0
I need to apologize, but I done the work.
The formula is:
=SUM(INDIRECT(CONCATENATE(ADDRESS(ROW(), 30), ":", ADDRESS(ROW(), 30+DAY($B$3)-3))))
Sorry for keeping you busy, but, after a cigarette and a coffee, far away from computer, I could manage to “invent” this formula.
What is doing: is summing all values, from day 1 of the month up to 2 days before ‘today()’.
The reporting date is entered in $B$3.
I suppose to post a sample, but it will take time to learn this facility.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Many thanks once again for support.

If this formula is replicated for a significant number of records, the volatility score (read: inefficency) would go up accordingly because of INDIRECT, ADDRESS, and ROW which are all volatile functions.
 
Upvote 0

Forum statistics

Threads
1,216,045
Messages
6,128,484
Members
449,455
Latest member
jesski

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