Excel: Number of weeks, when the income of weekends are more than the income of weekdays? - excel

For example I have this sheet:
I want to calculate the number of weeks when the income of weekends are more than the income of weekdays.
(Income of weekends = Income of Sunday's + Saturday's income)
(Income of weekdays = Income Monday's + Tuesday's + Wednesday's + Thursday's + Friday's income)
For example in week 1: weekdays earning = 10$, weekends earning = 15$. Weekends earning > Weekday's earning
I'm not allowed to use helper columns.

If the layout is absolutely regular in full weeks as in the sample, I would use Offset to get the weekends and weeks as ranges, then Subtotal to get the sum of each of them as arrays, then compare them and finally use Sumproduct to get the count of those where weekend pay is greater than week's pay:
=SUMPRODUCT(--(SUBTOTAL(9,OFFSET(B2,ROW(INDIRECT("A1:A"&INT(COUNT(B:B)/7)))*7-2,0,2))>
SUBTOTAL(9,OFFSET(B2,ROW(INDIRECT("A1:A"&INT(COUNT(B:B)/7)))*7-7,0,5))))
The Row and Indirect are used to work out how many complete weeks there are, and so how many times the process has to be repeated.
Note - uses Indirect and Offset which are volatile and may give rise to performance issues with large sheets.

Related

Calculation weekly quantities based on monthly data

I have been struggling to solve an issue to calculate monthly packages sales based on purchases during defined weekly time ranges. I have the following sample data:
Original Data :
The sales quantities are for two products A and B combined. A buyer X purchases 5 B packages on the first week of every month, another 4 on week 6 then 4 packages every 10 weeks.
I added the highlighted columns to the original table. I tried the following but the calculation I made in column E seems to be the sum of sales for B packages from the actual month until the end of the year rather than only for the current month. The formula I used in cell D2: '=(C2-6)/10', i.e. calculating how many 10-week ranges during the year after deducting 6 weeks. The formula I used in cell E2: '=5+4+4*D2', i.e. 5 is the initial quantity in week 1, 4 is the quantity in week 6 then 4 times the amount of 10-week ranges.
Calculation :
Is there a way, or a formula to calculate the monthly sales quantity for product B only?
I design from scracth the table to reflect the model I have understand:
Column D is for sales the first week of the month, column E is for sale on week 10 and column F is for sales every 10 weeks.
Formulas are spanish but are easy:
mes stands for month
si stands for if
residuo stands for residual
suma stands for add
It's quite complex and there are many many criterion when we try convert weekly sales in monthly sales. My criterion was every day of a week computes to the month of the Monday of that week.
I hope have met your requirements.

MS-Excel Interest calculation using =IF

I want to calculate an interest on a fee, that is if a client has not paid full amount of fee before the 15th of the month an interest of 10% should added to the amount to be paid
my cells are
Amount payable Column B
Amount paid Column c
upstanding amount Column D
Date for payment Column E
penalty to be Paid 10% Column
How do i calculate this ?
i tried the below formula and had Err:509
=IF(E2=TODAY()>15, "Overdue" "B2*10/100",)
what i was trying to accomplish is .If today is on the 15th or the date is pass 15th of the month and there is upstanding amount to be paid attract a penalty of 10%
Things you could try
1) =if (e2>15, "overdue", b2*.10) or
=if (text (now (),"dd") > 15, "overdue", b2*.1)
You don't have a true and a false statement here (or rather the false statement is blank), also I don't know what you're trying to accomplish with e2=today ()>15 - if you're trying to get the day of the current month, you'll need e2=day (today ())>15

weekly spend formula in Excel 2007

Can anyone help please?
I have a spreadsheet where A:A contains dates and B:B shows the amount i spent on that day in relation to the date in A:A.
What i would like to do is have C1 show a running total of what i have spent this week.
I am using Excel 2007 and i cannot get my head around this.
I am going round in circles here, i can get =SUMPRODUCT((WEEKDAY(A2:A1000)=5)*(B2:B1000)) which shows how much has been spent on a thursday, justcannot work out how to say for the last week
You can apply the SUMIFS function with the TODAY functio and WEEKDAY function to gain a total of the current week.
'for a Sunday to Saturday week
=SUMIFS(B:B, A:A, ">"&TODAY()-WEEKDAY(TODAY()))
'for a Monnday to Sunday week
=SUMIFS(B:B, A:A, ">"&TODAY()-WEEKDAY(TODAY(), 2))
'for the previous Sunday to Saturday week
=SUMIFS(B:B,A:A, ">"&TODAY()-WEEKDAY(TODAY())-7,A:A, "<="&TODAY()-WEEKDAY(TODAY()))
=SUMIFS(B:B, A:A, ">"&TODAY()-WEEKDAY(TODAY(), 2)-7,A:A, "<="&TODAY()-WEEKDAY(TODAY(), 2))
The total for other 7 day periods can be returned with a little maths.
I've used the SUMIFS function here as the syntax changes between the SUMIF function and SUMIFS. Using SUMIFS in all cases means that you do not have to alter the syntax depending on whether you are using it one condition or multiple conditions.
Make it simpler.
Add a column before the DATE column and call it WEEK
In A2 use (x should be 1 , 2 depending on the system for your country)
=Year(B2)&WeekNum(B2,x)
1 = week start sunday
2 = week start monday
then in D2 use ( and drag it down the column)
=SUMIF(A$2:A2,A2,C$2:C2)

Excel Prorated SUMIF

I have a worksheet with 2 columns, one is a dollar amount, and the other is a day of the month (1 through 31) that the dollar amount is due by (the dollars are income streams).
So, I use the following formula to SUM all the income streams due on or before a certain day:
=SUMIF(C5:C14, "<="&$B$42,B5:B14)
Column C is the due day
B42 is the cell in which I input the day to compare to like "15" for "total of all income due on or before the 15th" - the idea is to have a sum of all income received for the period.
Column B is the dollar amount for each income stream.
My question is:
Some of the income streams don't have a day next to them (the day cell in column C is blank). That means that that income stream doesn't come in as a check or a chunk on a certain date, it trickles in roughly evenly through out the month. So if the amount for the income stream is $10,000 and the day is 15 in a 30 day month, then I should add $5,000 to the total.
That would be something like:
=SUMIF(C5:C14, "",???)
So where the due date is blank, select ???. ??? isn't just the number, it's the number*(given_day/total_days_in_month).
So I think what I need for an accurate total is:
=SUMIF(C5:C14, "<="&$B$42,B5:B14) + SUMIF(C5:C14, "",???)
But I'm not sure how to write that exactly.
Here you go:
SUMIF(C5:C14, "",B5:B14)*$B$42/DAY(DATE(YEAR(A1),MONTH(A1)+1,0)))
It depends on how you want to handle the number of days in February. You could use CHOOSE(Month($B$42),31,28,31,30,31,30,31,31,30,31,30,31) as the denominator, and DAY($B$42) as the numerator.
If you need to able to accommodate varying years where the number of days in February depends on the year in $B$42, then a more flexible approach could have a lookup table of years and the number of days in February in that year, and the 28 value in the CHOOSE formula above would instead be VLOOKUP(YEAR($B$42),MyYearLookupRange,2,false).

How to calculate a monthly average when the month is not finished

Let's say I have a 12 cells on column A with the sales for each month last year. To calculate a monthly I can do a simple formula like this in A13 =sum(A1:A12)/12. But in column B I have the sales for this year, not a complete year, and August is not finished, but I have the running amount of sales for this month, so far. What kind of formula can I use to return a more accurate average?
Eduardo
Divide the current total by the total number of days in the month that have passed so far. Then multiply by the total number of days in the month.
If you are only looking for a projection for the year I would recommend this:
Divide the sum you have for the current year * 365 so far in the data by days to date. That will give you a cheap sum.
sum * 365 / total days to date
Ideally you could figure out the ratio of revenue and you have a seasonal business:
Last year to date / last year total = Last year percentage to date
This year to date / Last year percentage to date : would project the average for the full year.
Easy 2-step process:
I have my data in two columns: Date, # of Widgets Sold
Add a 3rd column "Month", and use the month and year function to return the month for each date (format cells as a number) (e.g., =MONTH(A2)&"/"&YEAR(A2) )
Generate a pivot table using the # of Widgets Sold and Month columns that sums/averages the data by month

Resources