Macro For Procuring Values From Dataset Using Different Matching Criteria
Dec 3, 2013
I am recording and editing steps in order to procure unique ID's from a dataset and eliminate the manual intervention for this process. Macro works seamlessly in most of the scenarios except for the one mentioned below where it performs a step which is not really required.
Let me explain the scenario in detail:
-Sheet 1 contains the list of trades as per client's system and Sheet 2 contains the trades as per internal system
-Need to do several permutation and combination in Sheet1 in order to extract the unique ID's from Sheet 2
-Scenario 1 - lets assume I have 100 records I concatenate few common fields in both sheets and use the simple code mentioned below to fill the all rows with the lookup formula
Range(Selection, Selection.End(xlDown)).Select
Selection.FillDown
First scenario itself might populate the unique id's for all the 100 trades or might give partial result which will prompt for the next scenario. If the first scenario generates the Unique ID's for 99 records I can filter on "#N/A" and update a different formula to fetch the unique id using different combination. However in the initial stage I wouldn't know the # of unmatched records because of which I have the standard selection till end and fill down codes in the macro, which would end up filling all the blank cells till the end, which takes unnecessary time.
simple validation code which ensures that if the # of unmatched record is more than 1 only then the selection till end and fill down codes comes into picture otherwise simply update the formula and populate the result.
View 1 Replies
ADVERTISEMENT
Jul 8, 2013
In one sheet I'd like the user to select from 3 dropdown lists certain predefined values.
On the second sheet there is a long list of unique cells (one column, that can't be split into usefull columns with text to columns or something). I want to find the cell that holds the three text choices. These can be in different order to make things more complex. How do I create a search that finds that one match.
Example
The user selects "AAA" and "DDD" and "FFF" from the dropdown lists
The formula should find that one cell that holds this value: "FFF JJJ GGG DDD CCC AAA". This is the only cell that holds all three chosen values in one text. In the end I would need to have the row number of that cell,
View 7 Replies
View Related
May 14, 2014
I have a grid that I need to lookup and return the project hours for each system from the data set. The grid has the projects listed in the rows and the systems listed across the columns. The data set has a list of each projects systems hours. I am having problems with the formula when the data set has multiple records (multiple systems) for each project. It seems very simple, but I just can't get my arms around it. Please see the attached for example.
View 7 Replies
View Related
Oct 3, 2009
How do you load an array with values from cells matching a criteria?
I want to look for the number 1 in row 5 and put the Adjacent values in Row 2 in an array.
So here my array should have 1,3,6
Dim CountOne As Integer
CountOne = Application.WorksheetFunction.CountIf(Worksheets("Tool Administration Form").Range("B8:AE8"), "1")
Dim All As Variant
Dim rCell As Range
Dim ArrCnt As Integer
Dim lArrVar As Long
ArrVar = 0
Do
For Each rCell In Worksheets("Tool Administration Form").Range("B8:AE8")
If rCell = 1 Then
ArrCnt = ArrCnt + 1
All = Cells(-3, 0).Value
End If
Next rCell
Loop Until ArrCnt = CountOne
I keep getting errors... I don' tknow how to fill the array properly wiht the values in the cells.
Example:
A B C D E F G
1
2 1 2 3 4 5 6 7
3
4
5 1 2 1 3 3 2 1 4
View 9 Replies
View Related
Apr 26, 2007
I have three worksheets. The first one has a 20 digit code that is broken into eight sections ( cells) and an amount assign to it. There are currently 150 codes but can grow bigger as new codes are assigned with their own amount. The other two worksheets have the same breakdown for the code but will be filled in as needed. They will record additions or subtractions to the code, like a register. I would like to then summarize (on a fourth worksheet) the +/- activity from worksheet 2 and 3. To do this I will copy the first worksheet then setup three additional columns one will be Increase the other Decrease and the last one Balance. What I will need to make sure that I only pick up the amount for the right code. So I need to create a formula that makes sure that it compares wks 2, cell A1 to wks 4, cell A1 AND wks 2 cell B1 to wks 4, cell B1 AND wks 2, cell C1 to wks 4, cell C1 and so fourth until the eighth breakdown of the code. When this is true then I will need to add the amount that was recorded on wk2 or wk3 for that code on wk4. The codes may be used various times so the sum of the values of wk2 or wks3 will need to be cumulative.
I've been reading about Sumproduct and I have created this formula but the result is # NUM....
View 9 Replies
View Related
Jan 9, 2007
I have a worksheet with two tabs.
First Tab
Account Name
Account Number
Second Tab
Account Name
Account Number
Account Ship Location Number
On the first sheet each account name and number only appears once.
On the second sheet there may be multiple entries for each Account Name and Number.
On the first tab for each row I want to compare the Account Number column to the Account Number column on the second tab. Where I have a match I need to count how many unique Account Ship Location Numbers correspond.
View 9 Replies
View Related
Jun 4, 2013
I have a worksheet. I would like to count unique number of "Trans" in column A only if value of cells in column B "Type" equals "Return". In example below, I would want to see the value "3" as total.
Trans Type
1 Return
2 Return
2 Return
3 Exch
4 Exch
5 Return
5 Return
View 9 Replies
View Related
Oct 23, 2007
IS there a way to filter a dataset using the criteria in a hidden column? Auto-Filter will not allow this, and Advanced Filter is not user-friendly for the end-user of this file.
View 2 Replies
View Related
Jun 15, 2013
I have attached two documents. One is called "Zone Destination" which is a template I designed. The other file is called "Schedule5_4" which gets downloaded from a work server once a week that contains all employees and their shifts for the entire week. What I am able to do so far is extracting the first row using index and match but I don't know how to extract any of the rows that follow. an employee might have several rows for one day based on a lunch or if they are working in multiple zones during their shift.
Zone Destination File -- start tab has the template in place that gets copied over when you create a new tab.
-- employeeroster tab contains the employee roster that i use to match with the schedule5_4 file. i changed the names and also reduced the amount to make it easier to read. i have over 80 employees but for this example, i only made up a handful.
schedule5_4 File -- this file contains all the data that I need to pull from. The criteria that I am using is by employee and date. I'm matching from the employee roster tab and also the date in cell a1 located in the zone destination file.
[URL]
View 5 Replies
View Related
Jun 24, 2006
Column A Column B
1 b
1 1
1 2
3 4
I need a macro that if value in column b matches with value in column a, delete it both the value in column b and a and put the deleted value into column c. now my value in my columns is a combination of numbers and letters and it can have this characteristic too: `2076 or `FI7890
View 3 Replies
View Related
Jan 27, 2014
see attachment below for easier comprehension of what I need to be done. Note that I have around 20 subjects (2 in example) and about 15000 values per subject (5 per subject shown) Basically, I want matching rows to be aligned (see grey) and non-matching rows to be deleted, throughout the 20 or so subjects.
Exemple.xlsx
View 6 Replies
View Related
Dec 4, 2006
I want a macro to compare each value on workbook 1, Sheet "Destroyed", column "C" against each value on workbook 2, Sheet "ERT Master", column "B". For each instance where the value on workbook 1, matches a value on workbook 2, the row where the match is found on workbook 2 needs to be highlighted in yellow from columns A to H. This needs to be repeated for each value in column "C" of workbook 1.
View 9 Replies
View Related
Oct 22, 2013
a macro (that i will link to a control button) that will autofilter a data set. The problem i have is the macro i wrote below, It might not be the best looking macro in the world, but it would work for my purposes if i can get the part that does the autofiltering to be more dynamic. meaning, instead of a hard coding "Retail" in the macro, id like it to reference a cell so that the user can type whatever they want, then click the button and it will filter based on what they type in.
this is what i have
Sub Filter_Button()
With Sheet2
AutoFilterMode = False
Range("A6:M6").AutoFilter
Range("A6:M6").AutoFilter Field:=2, Criteria1:="Retail"
End With
End Sub
View 5 Replies
View Related
Jan 20, 2013
My task is to combine two large databases into one spreadsheet by extending the number of columns. The data from each database is 90% matching based on an identification number, however occasionally there are additional rows or unmatched identification numbers that need to be kept for analysis.
When this happens, there needs to be a blank row inserted to represent the missing data in the rest of the corresponding row.
I am having trouble finding a quick way to do this because I have approximately 12,000 rows (and columns up to DV when combined).
for example:
p1
data
data
data
data
p2
data
data
data
data
[Code] .....
needs to become:
p1
data
data
data
data
[Code] .....
I am guessing I will need a macro of sorts, So far I have made one column that tell me if the ID's are matching or not (1 or 0) and if they are not matching (0) I manually insert the rest of the row that is missing or make space for the duplicate data (which needs to remain).
View 5 Replies
View Related
Jun 10, 2014
I am attempting to create a macro that will carry out vlookup for each row in a data set
For simplicity testing this on a sheet where A1:A10 contains data 1 to 10, and B1:B10 contains a to j, and putting the result of the vlookup into column E.
The code I have written is:
[Code] .......
When I attempt to run this I receive an error message that says, "Unable to get the VLookup property of the WorksheetFunction class."
What do I need to change?
View 4 Replies
View Related
Feb 9, 2012
I have a large itemised call bill that i need to do some regular analysis on and wondered if I could automate most of it.
In column C is a list of mobile numbers, in column F the numbers they called (this is an itemised bill so each line represents one call, meaning each number has multiple rows) finally in column K is the cost of each call.
I want the macro to look through column F (number called) and if there are less than 5 instances of that number that are under 0.30 each in cost to be deleted.
Example: if in column F the number 07500 100100 appeared once with a cost of 0.29 I want it deleted but if it appears 6 times with an accumulated cost of 3.50 i.e. more than 0.30 per call averaged out, then i want it to remain on the sheet
View 3 Replies
View Related
Feb 28, 2014
I am having trouble finding an efficient way to expand a set of data that I have by adding another column to it.
Look at attachment : help.xlsx
I can do it manually but I have 5000+ rows of data that I need to selectively expand do accommodate the data from the new data set.
View 4 Replies
View Related
Jan 28, 2010
I have a cell (A1) that contains text.
That text will match a single value in a reference list (i.e. range of cells e.g. Z1:Z26).
When the match occurs (e.g. A1 = Z16), I want the format of the reference cell (fill color, text color) to apply to the cell of interest (A1).
The reference cells are manually formatted.
I know that I could create a long list of conditional format formulas instead of using the reference, but it seems that there must be some way to tell excel: if the cell value contents are equivalent, the formatting should be as well.
View 9 Replies
View Related
Feb 17, 2010
Is it possible to have a formula where it will retrieve a specific value on one sheet based on matching values? Unfortunately, hlookup wont work as there are several values in the table where the 'lookup_value' is the same.
Example:
On sheet 1 (titled BSRC), I have a table which has a list of values in column 1. On column two I have the 'lookup value' which needs to be matched and all values underneath it to be retrieved from sheet 2 (titled CSRD). The 'lookup_value' range is on row 9 of sheet 2.
I have attached a sample spreadsheet for clarification.
View 7 Replies
View Related
May 15, 2014
I would like to align the matching values in columns A and B but I want the values that correspond to b in c,d and e to go with the column b value.
C D and E don't necessarily have a value in there but if it does it needs to move with B
View 5 Replies
View Related
Jun 5, 2014
I have a data set (Set#1) that consists of a positional rank (1-240) and a dollar value ($46-$1) for each positional rank. It's not a straight line set.
DataSet.JPG
What I need to do is take that curve and apply it to another data set (Set#2) (1-240) and assign a dollar value ($46-$1) to each positional rank.
A "corner cutting" way of doing it would be an Index/Match to simply carry over the dollar value from (for example) #45 from my Set#1 to #45 in my Set#2. This could work reasonably well with data sets of the same size, but mine aren't always the same size, so I need to apply the curve itself. I
View 1 Replies
View Related
Dec 23, 2008
I have an output table that looks like the followings:......
There is 1 input for the spreadsheet: What month? Enter 9, 10, 11 etc. I need it to pull from a data sheet that is set up as such:......
So effectively it needs to vlookup the name in column A, (A, B, or C), and then it needs to match that to the column that has the same name as the output table (Crit.1 or Crit.2 and the number of the month above it (10,11,etc). I attached an excel sheet to better demonstrate
View 2 Replies
View Related
Dec 23, 2009
If you look at my attached example. I'd like the date line/columns in Sheet "8002372008" to be populated automatically with data from Sheet "Data".
Is this possible? VLOOKUPs and MATCH are what I was thinking, but I'm not sure how to do it.
I know it could probably be done in VB, but I don't want to have to click on each "800 Number" sheet to update it every time, so that my summary sheets are accurate.
View 10 Replies
View Related
Jun 30, 2007
I need to match data with specific criteria. Details of the problem are as follows:
I have 2 sheets: "Main" and "Sub"
In "Main" there are 3 Important Columns: Col "C", "I" and "AF"
In "Sub" there are 2 Important Columns: Col "I' and "N".
Value in column "C" of "Main" is same as value in column "I" of "Sub", but not in same order.
Now the specific criteria:
If value in Column "I" of "Main" is not equal to "Zero", then the macro should pick up the value from the corresponding column "C" of "Main" and search for the same in column "I" of "Sub". After matching the same, it should find corresponding value in column "N" of "Sub". Then the macro should pick up the value from column "N" of "Sub" and put the value in the column "AF" of "Main".
This is basic requirement.
I am unable to retrieve the right value for the same.
Fine tuining will be:
If the value in column "N" of "Sub" is "Fully Automated" then it should only write "Automated" in column "AF" of "Main". And If the value is "Manual + ...." then it should write "Manual" in column "AF" of "Main".
View 14 Replies
View Related
Feb 9, 2006
Col cCol dFormula
Lease TermCompany #6023%
3637%
4843%
6052%
12620%
247FALSE
368FALSE
48105%
609FALSE
Residual Table
Company #
127
438
569
10
Col b
Lease TermResidual %
1210%20%9%
245%9%6%
364%7%3%
483%5%2%
602%3%1% ......
View 10 Replies
View Related
Apr 22, 2012
Modifying the following line by replacing the row number in AC2 and Q2 by an incremental variable? I mean something like “AC”&Rw , “Q”&Rw, &Rw, Rw being my incremental variable used to go through the rows.
ElxJobNo=Evaluate("Index(Index(Jobnumbers,0,1),Match(AC2&Q2,Index(Jobnumbers,0,3)&Index(Jobnumbers,0,4),0))")
View 3 Replies
View Related
Jul 6, 2006
How do I return an offset value within a named range using a formula? For example, my range "RngTest" is from C3:J43. If a value of "Product123" is found within the range, (lets say its found in cells C3; E5 and E7), I need the accumulative values in the cells 'below' (in cells D3; F5 and F7) added ( SUM) and returned to cell L3.
Therefore if Cells D3; F5; and F7 have the respective values of 3; 4 and 5,
the value of cell L3 should be 12. Also, do I need to express "RngTest" or "C3:J43" or does it matter?
View 4 Replies
View Related
Mar 20, 2007
I am trying to solve a small problem that i have, I am not that good with VBA and need somehelp.
heres the situation.
Sheet 1 is filled in col.1= title, col.2= table# (ex. 1,2,...11)col3.= grid location (ex. a-1, a-2...a-10,b-1...b-10....d-10). I will enter a title then pick a table then a grid location.
On sheet 2 also known as table 1. col.1 =grid location (ex. a-1, a-2...a-10,b-1...b-10....d-10) col. 2 = title.
I want to create a macro or function that can evaluate sheet1 and pick out when col.2=table 1 and col.3 = grid loc. A-1.... through D-10 then give me what is in col.1.
this will have to be done for 11 sheets 1 sheet for each table.
View 9 Replies
View Related
Apr 5, 2013
I'm trying to build a formula on the matching text as below, im getting an value error, however when i press the FX key it shows the correct result.
Column A
Column B
Column C
Column D
[Code] ....
( I would like to match the below two criteria with the Row 1 and Row 2)
Co1
#VALUE!
Latest Forecast
Formula-->
IF(MATCH(A6&A7,B1:I1&B2:I2,0),"Ok","Not ok")
View 1 Replies
View Related
Jan 30, 2014
I'm trying to create an overview which shows a breakdown of the total minutes for each task on each given day.
I need to get a formula to work in the grey area which sums the total minutes (column C) based on matching two criteras of task (column A) and day (column b).
View 5 Replies
View Related