Delete And Insert Record Week On Week
Aug 6, 2008
I have a comparison model that looks at two weeks of data. I am trying to get around the deletion and insertion of records week on week. With the code below, I can currently find and correct the deletions and insertions to the list, and then resort the list so that the comparison will work.
Sub CheckForNewProjsRemovedProjects()
Dim MyCell As Range, oCell As Range, NewCell As Range
Dim Rng1 As Range
Set Rng1 = Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
' Columns("B:B").Select
Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"C1"), Unique:=True
For Each oCell In Rng1
For Each MyCell In Range("C1:C" & Range("C" & Rows.Count).End(xlUp).Row)
If MyCell.Value = oCell.Value Then................
View 9 Replies
ADVERTISEMENT
Jan 19, 2010
I am new to VBA & not sure of the full understanding of code copied from a workbook which worked on the same principle but with Monthly (12) tabs. I thought if modified to show weeks, the macro would be able to locate the current week tab & day/date within - but upon opening, the cell stops at WK19 & column O - rather than WK43, Column N (which changes daily).
Sub Auto_Open()
week(1) = "WK1"
week(2) = "WK2"
week(3) = "WK3"
week(4) = "WK4"
week(5) = "WK5"
week(6) = "WK6"
week(7) = "WK7"
week(8) = "WK8"
week(9) = "WK9"
week(10) = "WK10"
week(11) = "WK11"
week(12) = "WK12"
week(13) = "WK13"
week(14) = "WK14"
week(15) = "WK15"
week(16) = "WK16"
week(17) = "WK17"
week(18) = "WK18"
week(19) = "WK19"
week(20) = "WK20"
week(21) = "WK21"
week(22) = "WK22"
week(23) = "WK23"
week(24) = "WK24"......................................
View 9 Replies
View Related
Dec 11, 2013
I was wondering if there's a way to add a formula to calculate week over week % change automatically every week when I enter in new data. see the attached excel file for reference.
What I would like to have is the ability for the formulas in c5 and f5 to be able to auto-update to the newest week and the previous week's data instead of manually having to update it each week. So if I were to add a new row with data for week beginning 12/2, the formula in c5 and f5 would automatically update to calculate the week over week variance. I tried researching prior to asking the question on this forum, and I think it may be possible to do it using the index match function, but I'm not sure how to apply it in this case.
View 3 Replies
View Related
Mar 6, 2010
I have a running time sheet daily. It has 2 columns for Labor and 2 columns for travel
i.e. travel From / To 1300-1400 calculate 1 hour then travel home 1600-1700 1 hour this is calculated by the date entry 01/02/10 I have another calculation that tracks by the date i.e. 01/02/10 then Next job which all works fine.
The problem becomes how do I calculate a weekly total labor and travel by the date So added another column called weekly hour’s labor and use the Weeknum to determine which week is which day/date so the first Monday in January 2010 is week 2
2 problems
Having many multiple day / date entries are the same date x 7 days Monday –Sunday
(Relies on the date entered and the weeknum) 01/03/10 each line is complete however the dates carry over as does the time
When trying to calculate each row x 3 same date time then the value will be incorrect I need to calculate
Say 9.5 hour labor from the date 01/03/10 not 28.5 hours and then calculate the total weekly hours
01/03/10, 9.5 hours labor, 3 hours travel
01/03/10, 9.5 hours labor, 3 hours travel
01/03/10, 9.5 hours labor, 3 hours travel
i do have work and travel times for each job on the same line (separate columns) but I display the total here by date to summarize the totals
i have tried sum products and sumif to avail. I am using Windows XP SP2 with MS Office 2007
how do i calculate weekly hours by date and weeknum ?
Total Work per day
Total Travel per day
Daily....................
View 9 Replies
View Related
Jun 16, 2014
I'm trying to write a formula that will tell me when its week one or week two, week three and week 4 based on a given date of any month.
I'm using weekday formula but no luck.
View 6 Replies
View Related
Feb 5, 2009
I have to download a report every week and have been manually checking the report weekly for changes.
View 5 Replies
View Related
Nov 24, 2009
I have a column where I am convering the Date into a Fiscal week number.
For example 10/6/2009 is Work week 41
Now I want to show October Week 41
I need to add the month and the text "Week" before the week number. what is the formula I use.
View 3 Replies
View Related
Oct 14, 2009
I need to copy the values of a range on the weekly sales worksheet to the monthly sales worksheet. The last column is the total on the weekly sales. Part of the heading of the total column is the week ending date (e.g. 10/17/2009. On the Monthly Sales I have the months in columns by week ending (e.g. 10/17/2009).
Range I4:I28 to the monthly sales worksheet by date.
View 10 Replies
View Related
Aug 16, 2013
I had a column of text and numbers in col A; day of the week and date (taken from a web scrape, so have no control over how they are imported), such as in the following example. Additionally i have put a column of one's beside it in col B, and then summed them in col C.
A ..........................................................B .....................C
Friday 16/08/20131
Thursday 15/08/20131
Wednesday 14/08/20131
Tuesday 13/08/20131
Monday 12/08/20131
Sunday 11/08/20131
Saturday 10/08/20131
Friday 09/08/20131
Thursday 08/08/20131
Wednesday 07/08/20131
Tuesday 06/08/20131
Monday 05/08/20131
Sunday 04/08/20131
Saturday 03/08/20131sum=14
If i parse the text from the numbers, and then use a filter to remove Saturdays and Sundays, the sum total of col B will still remain the same. What i need is a method to totally delete or neglect Saturdays and Sundays so that the sum would equal 10 for example. Note that the data is updated daily, so in A1 today will be Friday 16/08/2013, but A1 tomorrow will be Saturday 17/08/2013. Also note that i have used 1's in my example, but that is just for explanation purposes, the actual data is varied.
I have just spent the last two days making this spreadsheet only to realize that weekend data is totally messing up my calculations.
View 4 Replies
View Related
Mar 6, 2014
i got a problem with date range.actually i wanna to insert date range automatically which is referring current week.
View 2 Replies
View Related
Apr 6, 2007
Is it possible to format cells to convert a date format of month/day/year to = year/week #/day of week? For example, 04/05/07 (April 5, 2007) would read as 7145, (7=last digit of year/ 14 = week number / 5 = day of week....Sunday being the first day of week)
View 9 Replies
View Related
Jun 21, 2006
How can i find the first day of a week
I have the week number and i need the date of monday of that week
Ex: Week number:24
First day of week(Monday):12-06-2006
View 5 Replies
View Related
Jun 27, 2006
I need the name of the day of the week from a date that has to be put together. This is going into a label on a UserForm.
I have a named range called wbDate. It is the month & year. The day of the month is the value of a TextBox (TBDay) on a UserForm. When I tried to combine these items, I used this
vToday = Month("wbDate") & " " & TBDay.Value & ", " & Year("wbDate")
vToday is dimmed as variant.
I am getting a type mismatch error and I'm not sure how to correct it.
What I am aiming for eventually, is the name of the day of the week.
View 4 Replies
View Related
Feb 11, 2014
In example file i wrote different dates along the column. How i can i write a filter in Table for showing only Thursdays from those dates?
File: [URL] .....
View 7 Replies
View Related
Oct 9, 2008
Does Excel know week numbers? e.g. Week 40 is Sunday 10/5/2008 to Saturday 10/11/2008. Here's what I have...
Column A Column G
date $ Amount
my data example...
10/5/2008 $10.00
10/5/2008 $20.00
10/8/2008 $12.00
10/11/2008 $8.00
10/12/2008 $25.00
10/13/2008 $75.00
What I want the formula to do is look in Column A find all of the dates that are in week # whatever and then look in column G and add all of those $ amounts. So the result would be...
Week 40 $50.00
Week 41 $100.00
View 3 Replies
View Related
Nov 2, 2008
1 2 3 4 5 6
11/1 11/2 11/3 11/4 11/5 11/6
sat sun mon tues wed thur
what i am trying to do is to be able to put a date in a cell and it would fille in the month day and day of week
=$D$1
=$D$1+E5-1
=TEXT(WEEKDAY(D6),"ddd")
cells are not correct in the formulas just copied them. i got this to work in a set up xls file when used it in the real setting i get ###.
View 3 Replies
View Related
Apr 6, 2009
I created a pivot table with daily dates listed from 1/1/2009- 3/31/2009. 3 months worth. I see i can group this data by hours, days, months, quarters and years but what i really need to do is group this by WEEK. Does anyone know a formula I could use to accomplish this?
View 3 Replies
View Related
Jun 5, 2009
Can somebody have a look at the workbook that I've attached.
I have set up a timeshhet calculator for work but the thing is, the hourly rates of pay are dependent upon the day of the week the Operative is working, and the time of the day.
We split the shifts AM & PM and the rates are decided as per the worksheet contained within the workbook "Rates".
The problem I am having is how to get the timesheet to understand the days.
For example, if an Op works the Sat night or Sun night, then the rate should reflect x1.5. If it's Sat/Sun daytime, then it's x1.25.
Again, and as per the "Rates" sheet (see top for the rate multiplier) Mon - Fri 09:00 - 17:00 is flat rate/standard hrs. If the work Mon - Fri evenings, then the rate is x1.25.
How can this be done?
View 10 Replies
View Related
Mar 17, 2009
I'm trying to set up a simple macro to loop through some number of dates on a sheet and blank out fields next to every instance of Saturday and Sunday. The only problem I'm having is actually finding the values "Saturday" and "Sunday"
Given a date in this format: 01/01/2009
I can convert to "Thursday"
Problem is, the vba code still "sees" 01/01/2009
I've tried copy / paste special / paste values to no avail.
I've tried changing it via VBA (a few different methods, including strings, formats, etc) with no luck. Even tried referencing my date cells from another spreadsheet and pasting the values back in. Can't seem to get 01/01/2009 to be "Thursday"
View 4 Replies
View Related
Aug 10, 2006
I normally use the WORKDAY function in order to create an involved scheduling
program. However, I have no idea how to create a formula that would count
Saturdays as a workday. I usually type in one date and then the dates kick
out to an end date several months later. How do I create a formula to
include Saturdays on a daily projection (e.g. A1=8/12/06, A2=8/14/06,
A3=8/15/06,etc...)?
View 9 Replies
View Related
Jan 26, 2014
Outlook allows you to easily specify, but eExcel always treats Sunday as the first day of the week by default. Yes you can manipulate that within formulas and functions, but if you use the autofilter in excel and choose "this week" (or "next week", or "last week") excel considers Sunday as the first day of the week. I would like to know how (or if) this can be changed to Monday as the first day of the week.
View 5 Replies
View Related
Sep 16, 2007
I've been trying to write code to filter a list of date base on day of week (Mon, Tue, etc)
My problem is that i can't find a way to code the filter criteria... since the date does not contain any week of day constant. i don't want to create another column in my sheet to show the week of day constant and filter this instead.
Here's my not yet finished code...
Sub DayOfWeek()
Dim sAnswer As String
Dim bWkDay As Byte
Dim loMyData As Range
Dim iFilterCriteria As Integer
Dim Dateserial As Integer
Application.ScreenUpdating = False
sAnswer = InputBox("Please select day to display data (first 3 letter of the day, eg. mon)", Title:="Select day to display")
View 9 Replies
View Related
Jan 15, 2008
I have a spreadsheet where column a = date, b = weekday and c= total calls. I have this array formula to get the true average for the entire month. {=average(if(isnumber(c4:c34),c4:c34))}
The question is can I do something similar to get a true average adding in the day of the week?
What I need is the average amount of calls per weekday.
View 9 Replies
View Related
Feb 28, 2008
I have had an attempt at an array formula, which hasn't worked out :/
{=SUM(AND(IF(Data!B4:B107=A16,Data!C4:C107,""),IF(Data!A4:A107=B$12,Data!C4:C107,"")))}
Its because I want 2 different conditions as you can see above, matching both a week, and a season before summing the values. I can get it to work on a week, but then it will add up every matching week in all different seasons, and i can get it to do season, with no week but not both together :f
View 9 Replies
View Related
Feb 4, 2009
I am also using the following formula to return the date in Cell BE1:
=TODAY()
I am using the following formula to give me the ISO week number in Excel in Cell BE2:
=1+INT((BE1-DATE(YEAR(BE1+4-WEEKDAY(BE1,2)),1,5)+WEEKDAY(DATE(YEAR(BE1+4-WEEKDAY(BE1,2)),1,4),2))/7)
and the year in Cell BG2:
=YEAR(BE1)
I then use the following to give me the wk and year in this format "wk-yr", i.e "6-09" in Cell BF4.
=CONCATENATE(BE2,"-",RIGHT(BG2,2))
My question (finally) is that I am using this in a sheet that tracks issues that have deadlines. I manually enter in the dealine in the format "wk-yr". I have conditional formating that then colours a cell amber if it equals the current week and year, which is given in Cell BF4.
I want to use a traffic light system that will flag all issues in the weeks before the current week red, and the weeks after the current week in green, i.e. red = late!! I can't get my head round how I use a formual in teh conditional formating to correctly identify the relevent weeks? Any one any ideas? I could have the following situation for example (assuming that the current week is wk6 2009) and the formating should apply the colours as per my brackets:
10-08 (RED)
5-09 (RED)
6-09 (AMBER)
6-09 (AMBER)
7-09 (GREEN)
10-09 (GREEN)
6-09 (GREEN)
2-09 (RED)
View 9 Replies
View Related
Jun 18, 2009
I require a function that calculates the average amount for each day of the week for a range of dates.
I'm a little new at this and I though that something like this would work but it doesn't. The TEXT function doesn't accept a range so I don't know...
=AVERAGEIF(,TEXT(,"dd")="01",)
View 9 Replies
View Related
Jan 15, 2007
I have a project I am working on that I need to be able to determine if the date is a Monday. If it is I look at date for the previous friday, if not then just the previous day.
Example with psudo code ....
View 9 Replies
View Related
Apr 11, 2007
Is it possible to format in a macro such that dates that you extract from another workbook can be reformatted in such a way: mm/dd/yyyy Day, for example, :03/23/1990 Sun?
View 3 Replies
View Related
Sep 6, 2007
I have a series of data in different columns, one of them is the date (daily, for like 5 years, exept weekends and national holidays), but I want to make another table with weekly data (which should be the sum of the daily data in a week, for each column). I thought there might exist any combination of formulas for that, to put once and drag it, and maybe it's pretty obvious, but even though I thought about it a lot, I couldn't find the solution.
View 6 Replies
View Related
Jan 7, 2008
I have some keys in a file that are of the form WK05, meaning that it refers to the 5th calendar week (of this year). I would like to write a function that gives me the first day of this particular week, in this case it would be 28/1/2008
View 5 Replies
View Related