Solved

Subtotal

Posted on 2014-07-29
9
75 Views
Last Modified: 2014-07-30
In the attached ss i have a tab called "Sales"

Column E is a weekly subtotal columns where i have manually calculated the subtotal for two weeks, can i have some formula that can drag down and calculate the subtotals

I basically need a running total for Sundays

Thanks
Howl-Sales.xlsx
0
Comment
Question by:Seamus2626
  • 5
  • 4
9 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40226756
Hi,

pls try

as Array formula (Ctrl-Shift-Enter)

=SUMPRODUCT(($C$2:$C$1500),--(CEILING(($A$2:$A$1500-DATE(YEAR($A$2:$A$1500),1,1)+WEEKDAY(DATE(YEAR($A$2:$A$1500),1,1),2))/7,1)=WEEKNUM(F8,2)))+SUMPRODUCT(($D$2:$D$1500),--(CEILING(($A$2:$A$1500-DATE(YEAR($A$2:$A$1500),1,1)+WEEKDAY(DATE(YEAR($A$2:$A$1500),1,1),2))/7,1)=WEEKNUM(F8,2)))

Regards
0
 

Author Comment

by:Seamus2626
ID: 40226788
Thanks Rgonzo, i enetered that in and its entering the subtotals on mondays, and has value errors and £0, where as the cell should be blank unless the corresponding cell in Col B = Sunday

Did you enter that on my ss i attached:?

Thanks
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40226971
Yes

see example
Howl-Salesv1.xlsx
0
 

Author Comment

by:Seamus2626
ID: 40226999
Thing is Rgonzo, you have put that into the cells where Sunday is adjacent, whereas i need to put formula into E2 and drop down, so it is automatically finding sunday and returning a subtotal for previous week or remaining blank if not Sunday

Thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 40227064
Do you want to the last total

=IF(MAX(F3:F1500)=0,"",SUM(--($F$3:$F$1500=MAX(F3:F1500))*IFERROR((E3:E1500)*1,0)))

in Sheet Sales 2 formula without helper's formula

BTW

Corrected Formula  
=IFERROR(SUMPRODUCT(($C$2:$C$1500),--(CEILING(($A$2:$A$1500-DATE(YEAR($A$2:$A$1500),1,1)+WEEKDAY(DATE(YEAR($A$2:$A$1500),1,1),2))/7,1)=WEEKNUM(F8,2)))+SUMPRODUCT(($D$2:$D$1500),--(CEILING(($A$2:$A$1500-DATE(YEAR($A$2:$A$1500),1,1)+WEEKDAY(DATE(YEAR($A$2:$A$1500),1,1),2))/7,1)=WEEKNUM(F8,2))),"")
Howl-Salesv2.xlsx
0
 

Author Comment

by:Seamus2626
ID: 40228569
Hi Rgonzo,

I want to put a formula in E2 and drag all the way down. When the formula sees that its corresponding value in B = Sunday, it needs to create a subtotal for the previous 7 days sales summed.

So with the data i have provided, it would look like my attached ss in tab sales

But i need to be able to have the formula already in the ss so it doesnt need to be manaully added
0
 

Author Comment

by:Seamus2626
ID: 40228570
attached
Howl-Sales.xlsx
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40228607
Hi,

pls try in E2 and fill down

=IF(B2="Sunday",SUM(OFFSET(C2,-6,0,7,2)),"")

Regards
0
 

Author Closing Comment

by:Seamus2626
ID: 40228630
Legend!

Thanks Rgonzo
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now