Use VBA To Identify Multiple Days In A Schedule

Jan 3, 2013

I have managed to write some vba using sumproduct to identify multiple instances of a day in a persons schedule ... following is the code:

Sheets("Schedules").Activate
Range("A" & jj).Select
LastRow = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
Range("AF3").Formula = Evaluate("=SUMPRODUCT((A3:A" & LastRow & "= """ & WeekDay & """)*(B3:B" & LastRow & "="""
& ClName & """))")

[Code] .....

The sumproduct essentially checks to see for example that in the A3:AA range whether we have a match .... say a Monday that appears more than once for the client ... say John G. In the example I am using we have John G with three time slots on Monday that he is scheduled thus kkk = 3.

I would like to loop through the ranges in the Schedules sheet and copy those rows where the above statement about John G is true. For the rest of the example we just assume that John only has one scheduled time for each of the rest of the days of the week so in those instances kkk = 1.

I have the following code to loop thru the days of the week:

For j = 3 to 11
WeekDay = Range("AE" & j)
...
if kkk > 1 then
WeekDay = Range("AE" & (j-cntr))
else
WeekDay = Range("AE" & j)
Next j

There is a whole bunch of code, including he sumproduct above that then loops thru the Schedules sheet in the appropriate rows and columns copying the instances where John G has a schedule for a particular day of the week.

First I create a schedule sheet for John G and the vba code enters the first row of data ... Monday etc etc in Row A3 thru H3 of this new sheet.

On the second loop through the data on the Schedules sheet it finds another Monday for John G and this is where I would like to hold the WeekDay variable such that it is still pointing to Monday for a total of three loops since kkk = 3 for John G and Monday.

The problem that I am having is that if I hold WeekDay to point at Monday by something like WeekDay = Range("AE" & (j -1)), it seems to work for two instances ... that is the first instance, WeekDay = Range("AE" & j), j here is 3 for example, then the next pass we have WeekDay = ("AE" & j) and here j = 4 but since I reset it back one we are still at 3 ... this unfortunately only works once then I get and empty WeekDay = "". The loop has to loop through the Schedules sheet and I use jj as a variable here which increases by one each pass through ... next j, however ... increases j but then I try to reset it back by one so that it is still pointing to Monday in the Range("AE" & j) section of the Schedules sheet, it is a temporary range.

View 1 Replies


ADVERTISEMENT

Counting The Days Worked And Days Remaining On A Schedule Automatically

Sep 1, 2007

I'm basically looking for a forumla that will count each employees total scheduled work days for the month inserted and then depening upon the day it is will show how many days the employee has left to work for the month.

View 9 Replies View Related

Work Schedule: Insert The Numbers 1-6 Into The Spreadsheet Throughout The 14 Days For Each Employee

Oct 7, 2009

I developed a 14-day work schedule and I assigned each different job position a number. The different job positions are numbered 1-6 and are as follows: #1=5:30am-1:30pm, #2=6:00am-2:00pm, #3=9:30am-1:30pm, #4=12:00pm-8:00pm, #5=1:00pm-8:00pm & #6=6:00pm-8:00pm. Numbers 1,2,4,5 clock-out for a 30 minute lunch break, while the other numbers do not.

My goal is to insert the numbers 1-6 into the spreadsheet throughout the 14 days for each employee, and have Excel calculate the total number of hours for each employee in the far right column. I would also like "V" & "H" to equal 7.5 hours. This would save a lot of time instead of going through and adding up the hours with a calculator

View 3 Replies View Related

Amortization Schedule For Multiple Loans?

Nov 18, 2012

I need to create an amortization table for several thousand loans. I could create a seperate amortization schedule for each loan, but as you can imagine, doing so would take a long time.

These loans have varying interest rates, loan periods, and beginning balances, so it is not as if I could just add the beginning balances together and amortize on that basis.

It seems like this will require a VBA macro, however my programming skills are a little rusty.

View 3 Replies View Related

Days Between Two Dates Separated Into Days Per Month For Multiple Dates - Excel

Feb 13, 2013

I wanted to determine the number of days between two dates. Specifically, if the initial date is in one month, and the second is in a different month and an output would result a number of days in each month until the final date. BUT I have a large amount of data to do this for in a list view, way to put a formula in excel and just drag down the entire list to get the required information. see below for an example.

The result I'm looking for is the separate the months and only show the relevant months between the two dates in one cell or the adjacent. Something similar to the table outlined below.

Input Data
Result
Start Date

[Code]....

View 3 Replies View Related

Identify Multiple Locations More Than X Miles Apart

Mar 16, 2014

Distance Calculations Example 1.xlsx

I need quickly identifying multiple locations based on their proximity to an initial location and each subsequent location selected. I have attached an example spreadsheet that is structured in the following manner:

Cell H2 is the 'initial' location that will be used to identify all subsequent locations
Colums A through C are location specific details including latitude and longitude of all 450 possible locations
Column D is a distance calculation based on the difference betwen the location in column A to the 'initial' location in cell H2
Cell F2 is the necessary minimum distance between locations(in miles)
Cell G2 is the number of locations needed(this will vary)

What I am trying to accomplish is to fill column H with the number of locations specified in cell G2 that are atleast the minimum distance in F2 apart from each other, like drawing virtual circles around the locations on a map.

I am pretty sure this can be done with a Macro, but am not sure if that is the best solution or not. I am a novice Excel user, so even though I don't know the solution, I can already see two issues:

1. Whatever the solution is, the reference in column D will need to change to calculate the distance for each subsequent location instead of staying absolute with cell H2(H3 for second location, H4 for 3rd, etc...)
2. With each selection that is made, any location less than the specified distance in cell G2 should be removed from any future choices for subsequent locations.

View 4 Replies View Related

Multiple Identify Duplicate Conditions

Aug 27, 2012

I have a spread sheet in which an account number is located in, lets say, column A. There can be multiple duplicate account numbers here, and thats ok.

However, there is another column, Col. B, which has the name of an action. There are multiple "actions" listed, but the each action can only occur once for each account number. I need to identify if an account number is duplicated and if so, does it have any duplicate values in B. If it does, highlight the duplicates.

View 1 Replies View Related

Identify Multiple Columns In Listbox

May 18, 2007

The following code takes the selected item from a listbox and populates another listbox with the item. The problem is that only the item from column 1 is populated to the other listbox. How can I populate the other listbox with the items from both column 1 and column 2?

Private Sub cmdSelToExc_Click()
Dim i As Long
With Me.lstProducts
' Copy all selected items, then delete.
For i = 0 To .ListCount - 1
If .Selected(i) Then
Me.lstExclude.AddItem .List(i)
End If
Next j
Next i
For i = .ListCount - 1 To 0 Step -1
If .Selected(i) Then
.RemoveItem i
End If
Next i
End With
End Sub

View 2 Replies View Related

Identify Multiple Maximum Peaks In Data Set

Oct 8, 2008

I have a set of data about with approx 7500 cells all contained in one column. The data has a series of peaks that happen, and I need to identify each peak value and place it in a cell. The peak does not occur at regular intervals but they are somewhat regular, as in within 130-230 data points. So, if one could find the first peak in the first 200 cells, identify it and store it somewhere, then look in the next 200, store it, etc. I don't know how to do that in excel.

View 4 Replies View Related

Identify Duplicates Across Multiple Colums And Rows

Dec 22, 2008

I have a spreadsheet with 20+ columns. Each column contains a list of invoice numbers, eg, 1234. The lists are all of different lengths (see below). I want to find a way to find/highlight/identify those invoice numbers that appear more than once in the entire sheet (eg if invoice 1234 is listed in column B, and also in column H, and/or if invoice 5678 is listed in column A, and also in column J, and also perhaps in column D, etc.)

I've searched this forum but haven't found anything about searching for multiple duplicates in multiple columns. Ideally the matches would be highlighted in different colours, (eg all cells that contain 1234 would be red, those that contain 5678 would be blue, etc., for ease of identification) but I'm not sure if that's possible. I've attached an example that I've shaded myself to show what I mean. I've tried the MODE function but that only tells me which invoice number occurs the most.

View 5 Replies View Related

Finding Keywords To Identify Product In Multiple Cells

Jul 23, 2012

Macro - it is currently set up to find a specific text, and activate that cell. From there, the spreadsheet has data in 6 cells in the 6 rows below the active cell. What I need the macro to do is to identify the product based on key words in a range of cells: that is, if any of those cells contain the string "total", than the product type is total, but if "total" is not found, look for keywords such as "alpha" and "beta", to identify the product type. If its not a total product, then i want it to look for "productB", "productc", and so on with relevant keywords until the product is identified.

I think IF(ISNUMBER(SEARCH can be used, but I'm not sure how, and I'm not sure how to search all 6 cells (to make things worse, the number of cells vary, so I'm using the "find" function to figure out the first and last cell that contain data).

View 5 Replies View Related

Find And Identify Duplicate Data Across Multiple Workbooks?

Dec 23, 2013

Book 1 sheet1 A

1234567
1234567
2658798
4083029
5507260
6931491
8355722
9779953
11204184
12628415
14052646
15476877
16901108

Book 2 sheet1 A

2658798
4083029
5507260
6931491
8355722
26587965
26365785
26143605
25921425
25699245
25477065
25254885
25032705
24810525

I need get the result Book 3 Sheet 1 A

All duplicates items from book 1 and book 2

View 6 Replies View Related

Identify/highlight Maximum Value Based On Multiple Criteria

Dec 4, 2009

I have a file with telemetry data for n individuals. For each individual I have data on a number of days, over the course of a couple of years. On any given day, I have from 1 to several "fixes" for an individual. Fixes range from 1 to 3, with 3 being the "best". Note that I do not necessarily have data for all individuals on a given day. What I want to do is extract the row with best fix for each individual, on each day for which I have data for that individual. If there is more than one best fix for an individual on a given day, then I want to choose the first best fix (temporally). Right now my data is set up with columns:

INDV DATE TIME FIX ....other attributes

INDV = unique code identifying the individual

The data is sorted by INDV, then by DATE, then by TIME.

I figured I could do this using nested IF statements, where "TRUE" would be added to a new column (e.g., HIGHFIX) in the row of the first highest fix on each day for each individual, but have not been successful in doing this. I've also tried conditional formatting. Again, no success here.

View 3 Replies View Related

Compiling Data From Multiple Workbook Into A Line By Line Master Schedule

Mar 30, 2013

I have about 180 workbooks which I need to compile into a Master Schedule.

All the tab 1's are different, these feed into tab 2, which the data has the same formatting throughout. The 2nd tab has the same data for A:F 1 but cells A:2 - F:2 down to row 9 are populated from tab 1, therefore different in each. I am trying to get a Master schedule that lifts the data in the fed cells into a line by line spreadsheet?

Is there a way I can get excel to look at a folder, then every workbook in it, the at the 2nd tab in every workbook, then list the cells as described above? I am not after a consolidation of this data, but a full list?

View 1 Replies View Related

Find Out How Many Ticks Were On Green Days, Amber Days And Red Days

Dec 19, 2008

I have a series of data that acts upon a traffic light system, i.e. Green, Amber and Red. These variables are posted along row 1 for example and there are 10 columns. Per column I have a tick and cross to answer a question. How can I find out how many ticks were on green days, amber days and red days? I have attached an example.

View 4 Replies View Related

Unable To Calculate TAT Between Multiple Days?

Feb 18, 2014

I want to calculate the TAT between multiple date: For example: I have a request I received on 1/2/2014 and I sent to Abhi on 1/2/2014(Same day) and I got a reply on 1/3/2014 from Abhi. I forwarded the same request on 1/3/2014 to Prasad and got a reply on 1/5/2014. And I closed the request on 1/5/2014. How do I calculate TAT on this ? I want the Tat to be shown as 3 days because I just took three days on the request to complete that is 1/2/2014, 1/3/2014 and 1/5/2014..

View 4 Replies View Related

Charting By Time Across Multiple Days

Jul 28, 2008

I have two sets of data that I would like to be compared over a 4 day period.

One set (Mill data) has an associated date and time (29-Jun-08 00:42:02 etc.), and has a value generated every 4 to 6 minutes.

The second set (Dump Grades) has an associated time only (13:24 etc.), and has values generated at random time intervals throughout each day.

The first issue is that I must assign a date to the Dump Grades data, which I just can't seem to do.

The second problem is that I don't know how to get all of these data points graphed on the same graph, as the date and time thing is throwing me for some reason.

My data right now is arranged in columns on separate sheets, organized by dates.

View 9 Replies View Related

Calculating Working Days For Multiple People

Jan 1, 2009

I'm using Excel 2003, and successfully working out start date (T2 in the formula below) plus duration in days (U2) minus any non-working days listed in a seperate worksheet. =WORKDAY(T2,U2,Holidays!C6:C17)

Each 'task' is on a seperate row, and the lead officer is named in Column E. How can I get the work day function to include the non-working days for each officer as well as the global non-working days in the seperate worksheet? I thought about using a vlookup, but that only matches the first non-working day for each officer rather than all of the non-working days.

View 2 Replies View Related

Downtime Tracking Between Multiple Days Only Counting Working Hours?

Jan 29, 2014

I have a downtime tracking spreadsheet that we want to be able to track the downtime on the line. However, we only want to count the working hours, not overnight, etc. I have added the weekend day work hours and Saturday work hours but haven't been able to figure out how to connect them into a formula with the down time.

View 1 Replies View Related

Excel 2010 :: Find First In And Last Out Data For All Days For Multiple Employees

Jan 23, 2014

I have to dig out data for all employees first entry and last exit for two months. My raw data is in sheet 1 as under:

LAST_NAME
FIRST_NAME
EMPLOYEE

[Code]...

I am using excel 2010

View 8 Replies View Related

Macro To Spread Amount Over Multiple Months Using Working Days As Weighting

May 5, 2014

Phasing Design.xlsx

We have a requirement to spread/phase amounts over multiple columns (representing months) using a weighting (represents working days per month).

We will calculate the weighting result in excel first (represented by a % per month), so the macro will be more of an allocation of row amount against the equivalent column %.

So far i have the following code:

VB:
Sub phasing()
Dim SourceA As Range
Dim Weight_ResA As Range
Dim TargA As Range
Dim i As Long

[Code] .....

View 2 Replies View Related

Count How Many Days Coming Due Within 90 Days Of Each Date Based On Today Function

May 27, 2012

There are dates in column C and I need to count how many days are coming due within 90 days of each date based on the today() function but do not exceed the 90 days.

Countif Today()+90

View 5 Replies View Related

Excel 2007 :: Count Number Of Days Between Two Date Where Off Days Are Friday / Saturday And Holiday

Mar 14, 2014

I am making process TAT(Turn Around Time) which required following information. In Excel 2007.

1-Count number of days between two dates where working days are (Sun to Thursday). So required to exclude (Friday,Sat + Holidays)

A1-Start Date Mar/01/2014
B1-End Date Mar/31/2014
C1-No Of Days 22
D1-Days between two dates 21
E1 To E10-Holidays

2-Count number of days between two dates where working days are (Sat to Thursday). So required to exclude (Friday + Holidays)

A1-Start Date Mar/01/2014
B1-End Date Mar/31/2014
C1-No Of Days 27
D1-Days between two dates 26
E1 To E10-Holidays

Note : Any weekend (off days) dates listed in holidays should not effect the query.

View 9 Replies View Related

Converting Days To Years,months,days

Jan 23, 2009

How can I convert the number of days for example 366 days to years, months, days 366=1year, 0 months, 1 day

View 3 Replies View Related

Rolling 7 Days, Extract The 3 Previous Days

Oct 19, 2009

I have a spreadsheet in 2007. Days across the top for an entire year. So 365 columns. I need a macro to extract the 3 previous days , today's column, and the 3 next days and load to a different worksheet.

HTML worksheet A:
1/1/09, 1/2/09..... 10/17/09, 10/18/09, 10/19/09, 10/20/09, 10/21/09 .... 12/31/09
10 11 ... 14 15 17 12 22 ... 28
a g ... g c d d a ... a

the macro would create a worksheet B(if run on 10/19/09):
10/17/09, 10/18/09, 10/19/09, 10/20/09, 10/21/09
14 15 17 12 22
g c d d a

View 6 Replies View Related

Change Days Added To Working Days

Jul 31, 2014

I've got the below so far, but where it says V2>=(Q2+5) , I would like it to add 5 working days instead, is this possible?

Code:

=IF(AND(T2="Awaiting",V2>=(Q2+5)),"Overdue","Raised within 5 Days")

It would also be great if there is a way to say that if T2="Not Required, then put "Not Required" in W2 (where the IF statement is)

View 4 Replies View Related

Reset The Schedule..

Jan 15, 2009

Is there a way to take the values between C2 & D2 and have them automatically post in column F ?

View 2 Replies View Related

Schedule, Organizing

Oct 15, 2008

I make our employee schedule at work, and so in Excel I have eight sheets for one workbook. (Employee schedule, then each day of the week) On each day is a table separating the shifts. Morning, Split and Night.

I was wondering if there was a way for Excel to look at the schedule sheet, and then automatically place each employee and their shift on the following day sheets. (example: Joe has 2-10 on Monday, 10-6 on Thursday and Friday) So the Excel puts Joe underneath Split 2-10 for Monday, and Morning 10-6 on Thursday and Friday.

View 10 Replies View Related

Schedule A Macro To Run

Nov 15, 2008

I am trying to schedule a macro to run at 11:45 pm every time. I use system scheduler to open the excel file and when I use this command to run the macro nothing happens. The workbook opens fine but the macro does not run. I only wants to run the macro once day even if I open the workbook during the day I do not want it to run.

View 13 Replies View Related

Schedule Template

Oct 16, 2009

We have huge restrictions on hours, and to avoid inputting, then revising the schedule into my companies scheduling module, then having to change it again when the boss looks it over, it's just confusing.

Anyway, I'll get to the point, I want to add the hours up in a row of cells for the week sunday through saturday. Like so:

1100-2100 | 1100-2100 | OFF | 1100-2100 etc... I want it to add these cells hours up and have the total end up in the 8th cell.

Is this possible? I am a new excel user, or at least, setting up my own sheet.

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved