Last Match Row Number In VBA Without Looping?
Jul 16, 2013
I have a data set like this
Date ID
3/1/13 ID1
4/1/13 ID2
5/1/13 ID3
6/1/13 ID1
7/1/13 ID1
Now i want a VBA Procedure/function that gives the row no. of the row in which ID1 is appearing last. I can do this by a worksheet formula in worksheet or by looping in VBA but I need it in VBA without looping. The reason behind avoiding loop is data can be extended up to 50000 rows,so looping will take too much time to complete.
View 8 Replies
ADVERTISEMENT
May 8, 2008
Recently I found here that using the following formula is great for looking up an item and returning a value from an adjacent column.
=INDEX(RETURN_THIS,MATCH(LOOK_THIS_UP,IN_THIS_RANGE,MATCH_TYPE))
It is far faster than doing it by way of code. My question is can this approach be modified to find not only the first matching item in a list but to sum all matching items?
I'll use an example Sheet1 and Sheet2:
Sheet1 serves as the summary sheet and contains, we'll say, city names and a column for totals by city
Sheet2 has raw data where one column contains city names, more than one row of data per city name normally. The adjacent column contains bandwidth usage in the form ##,###.##
View 10 Replies
View Related
Mar 6, 2007
to perform find, if match, ubdate, looping action in various sheets of excel through VB.
Currently, i am working at WAREHOUSE, where not having SAP OR ERP to perform [ maintain ] each & every in & out movement of products. However, i have been using excel to put in values for in & out manually....
View 6 Replies
View Related
Jun 19, 2014
I have modified some code I found in these forums that once I enter a value in a cell I can have it find the closest match to that value and scroll down the list and paste that value as an offset. The code works perfectly, but my data will often contain the same values repeated and these aren't duplicates and I need to know how to loop the code to ensure it doesn't just find the first value but also the second (if the first is already populated) Code is:
Sub findclose()
Dim rng As Range, Dn As Range, Mx As Single, oAd As String
Dim num As Range
Set num = ActiveSheet.Range("B1")
[Code] .......
---- What I need to do is insert a loop of some sort that basically says IF my offset cell has a value then to find the next closest amount and continue the macro.
So if my list was:
700
50
500
600
500
And I wanted to find 499 then my list would look like:
700
50
500 499
600
500
BUT if I wanted to match off another amount of 501 it would keep the 499 it found and then find the 501 making the completed list look like:
700
50
500 499
600
500 501
Right now the amounts are being overidden as I don't know how to loop it...
View 6 Replies
View Related
May 19, 2014
I recorded the following macro to move all entries in a sheet to a single column:
[Code] .....
Before the macro runs, my data is 11 rows long, after running the macro my data is 17 rows long.
What would be the syntax to add a loop for the macro to repeat the procedure every 11 rows until reaching the end of the data?
View 2 Replies
View Related
Aug 26, 2009
The following is the macro I have created, but I can't get it to loop. I need to insert a row below Labour-Overtime about 100 times in the document, not just once. Until the bottom. Also, active cell 1013 needs to be the same as what is above it. The series repeats and goes up by 1 every time. Not sure how to get that to work.
View 5 Replies
View Related
May 23, 2014
We know how INDEX/MATCH works, and it's very nice. I attached a COUNTIF to it to count how many times the index finds itself on another table; if it doesn't find itself, then it goes blank. However, this time I need to count how many times it finds a certain string condition in the other table.
sampleexcelhelp.xlsx
The columns that need to be filled are shaded in dark pink.
View 5 Replies
View Related
Jun 3, 2013
I have a spreadsheet listing all my vehicles and their respective oil filter part number. Now, some vehicles share the same oil filter and I am trying to find a way to return the vehicle description when using the filter # as a value. In my example below, I am looking to fill the third column with the Vehicle that also shares the same oil filter number. i.e. in the Dodge row, toyota would appear in the third column and vice versa in the Toyota row.
Vehicle
Oil Filter #
Also used with
Dodge
51515
Honda
54565
Toyota
51515
I am not well versed in excel lingo which is probably why I have a hard time coming up with a method that works.
View 4 Replies
View Related
Mar 9, 2009
I am adding rows of data to a worksheet based on criteria found in another worksheet. I've done this with two other worksheets in the same workbook without a problem.
In this case, I'm adding rows if the Utilization in the Master worksheet is >=150% and the logic I am using (which does not work) is:
View 2 Replies
View Related
Mar 19, 2013
Trying to find if the number entered in the input box "num_cmp" is => Cells(i, 2) AND
View 4 Replies
View Related
Oct 8, 2008
i want to match the cell phone numbers from the sheet working in the column C:C with the sheet GSM column A:A if it match the it has to print the data in GSM sheet column B:B in the working sheet
For (Eg) working sheet data as mentioned below
C
9841 9444 4424 4424 9841
GSM Data as mentioned below
A B 9762 Airtel 9762 Vodafone 9768 BPL 9768 Aircel 9782 Aircel 9783 Aircel 9095 Aircel 9715 BPL 9788 BPL 9788 BPL
if it match it as to update in working sheet as
C D 9841 Aircel 9444 Cell one 4424 Lan line 4424 Lan line 9841 Aircel
View 9 Replies
View Related
Feb 4, 2009
I have a whole list of numbers (e.g. 7, 23, 567) and I would like to be able to tell which range they fall within and return the category.
MinMaxCategory
1275Group A
276375Group B
376600Group C
601825Group D
8261,075Group E
Therefore 7 and 23 would be Group A, and 567 would be Group C. I can do as a long nested IF, but I'm sure there must be a better way.
View 2 Replies
View Related
Aug 7, 2009
I have the following formula that returns a number, however it returns the first number it comes to when the criteria is met,
View 2 Replies
View Related
Jun 22, 2009
in one column I am looking up the value Yes to return the row number.
=MATCH("Yes",C:C,0) in this case it returns a 2
I want to use this row number in a sum...
i.e. =sum(b2:b&x) where x is the row number from the formula above, but it just errors out.
View 9 Replies
View Related
Dec 24, 2009
Need a formula in M2 that will count the number of digits that match in each row. The digits in H:L compared to the master list in A:A119766. The count will be from 0-5 for each row. The digits must be in same column....
View 9 Replies
View Related
Jan 16, 2010
I have to do a vlookup in 12 sheets (named ranges)
I use the formula '=vlookup(a1;choose(1;range1;range2; etc);2;0)
In this case I have to change the 'choose index_num' every time to match.
Is it possible to do the lookup without changing the 'choose index_num'?
View 9 Replies
View Related
Jun 14, 2007
I'm trying to do something similar to the Vlookup function (or Index/Match method) but with two or more parameters to match instead of just one. I want to returnn the Row where two columns match the input parameters. Using Vlookup is a problem because it only returns the first one.
Is the standard method to us Vlookup for one parameter, then check the second and if it doesn't match reduce the search field, find the next and check the second again etc? That would work but it would be much simpler if there's a 2 parameter function.
View 3 Replies
View Related
Aug 1, 2008
I am looking to do the following:
Say I enter the following values into a spreadsheet:
5
7
4
24
32
Is there a way to enter the value "36" and have Excel find the two values of 32 and 4 which add up to 36 for me? I will obviously be dealing with much larger spreadsheets and would like to somehow save time by not having to hunt down possible combinations of the total value I'm searching for.
View 3 Replies
View Related
Jun 25, 2014
Cell P14 = 4.7
My array is H42:N72, in H42:H72 I have numbers 15,14,13....0,-1,-2,-3, etc...
In N42:N72 there is a corresponding $ amount that I would like to return based on finding the value which is greater than 4.7 (so, looking to match the $$ amount to the number 5 in column H42:H72)
I've tried using INDEX MATCH but can't figure this out.
View 10 Replies
View Related
Dec 11, 2013
In cell A1 I have a number. I want a formula that looks at that number and then looks at row C on sheet2 where there are rows and rows of numbers. I want the formula to return the nearest match to the number in cell A1.
View 6 Replies
View Related
Sep 3, 2013
I have a spreadsheet with 60k lines. One of the columns contains barcodes as per the example below, with a suffix of -XXX-XXX where the XXX are numbers. I want to highlight all the cells where the -XX-XX are the same number (as in the example below -303-303) how I can do this with a formula as I've around 30 spreadsheets each with 60,000 lines I need to sort through?
2500071189898-303-302
2500071189898-303-303
2500071189898-303-304
2500071189898-303-305
View 4 Replies
View Related
Apr 20, 2009
I am trying to use a Mid function to help me in my vba problem.
In my first table I have a list of account numbers. E.g. 'ZZ500543'
In my second table I have a list of account descriptions. E.g. 'Denis Morgan ZZ500543 leak from bath'
I need to match the account number in Table1 with the correct account description in Table2. I thought a Mid function would be the best option to pick out the account number in Table2? Is this right? How would I go about using it?
View 14 Replies
View Related
May 24, 2006
I needed to know how to find the closest match to a reference number
regardless of whether its larger or smaller. I did a search and found a post
back in March that said to use the following:
=SUMPRODUCT(((ABS(list-target))=MIN(ABS(list-target)))*list)
I applied it to my application and it works, I just have no idea why. Can
anyone explain this formula to me or tell me where I can find a good
resource.
View 11 Replies
View Related
Dec 27, 2011
I recently showed my supervisor (again) how to double click on a pivot table to generate a worksheet that shows the records that were used to calculate the pivot table information. He's finally impressed and now wants me to perform the following miracle:
Workbook 1 contains multiple pivot tables showing completed project costs. The tables are broken down by various topics such as designer, worktype, project number, and amount of overrun or underrun. I update this report each month with completed projects.
Workbook 2 is a new report recently developed which contains contract modifications for ongoing and completed projects. It is updated weekly but may be updated monthly in the future.
He would like to click on a project number in Workbook 1 and have it generate a report with Data from Workbook 2 showing all the contract modifications that were written for the project. I told him this would probably work better in Access but he gave me "that look" because he does not want to use Access. This will be shared with other members of management who also do not want to use Access.
View 4 Replies
View Related
Apr 18, 2013
I have a number that I'd like to see ranked within a separate range. Ie if the number is 25 and I want to see how it would be ranked if it were in a range of:
3
43
12
19
22
7
88
(The answer would be 3 - 3rd highest). The RANK formula requires an exact match...
View 2 Replies
View Related
Dec 19, 2008
Sheet 1
23456
23479
23409
23512
Sheet 2
23455
23456
23457
23478
23479
23480
23408
23409
23410
23511
23512
23513
In Sheet 1 there's a Column B with data I'd like to pull using a VLOOK-UP formula. However, I need it too look-up not only the exact number match in Sheet 2, but also the cell directly above it and the cell directly below it. In the sample above if I placed the VLOOK-UP formula in Sheet 2 (at for instance the numbers 23455, 23456, 23457), I'd need it to pull data from Sheet 1, Column B (for the 23456).
View 9 Replies
View Related
Nov 1, 2006
I have a spreadsheet, with a Match Formula, that appears not to work. It looks at cell F1, and scans through cell C2:C14, and want it to return the relevant row in Column B (My work network will not allow me to upload the file). Cell F1 is the name of the sheets within the workbook (one for every month). However my data currently only has Apr - Jun, but when I choose month May, the formula feturns Month June.
View 3 Replies
View Related
Sep 5, 2007
I am trying to acccess a cell value from a seperate worksheet. The cell reference needs to be generated by a seperate formula. In this example
=DSInfo!C28 // provides the correct result i.e the contents of cell C28 on worsheet DSInfo =MATCH(A4,DSInfo!C1:C35,0) //provides the correct row number - in this case 28
However on trying to combine the two =DSInfo!C&MATCH(A4,DSInfo!C1:C35,0) // provides only a formula error. I'm guessing this is a simple syntax error on my part but after hours of trying various ways I'm still having no luck.
View 2 Replies
View Related
Aug 27, 2013
I have a set of data (Data tab) that lists name, a high number, a low number, and the state that is associated with the name and range between the high and low number (see attachment). I am trying to figure out a formula that will return the state value based on a match of the name and the number between the high and low. I am trying to use Index/Match but i cant figure out the "between the high and low" portion.
tester.xlsx
View 2 Replies
View Related
Apr 3, 2014
I have 2 sheets in a file. One is given to me from our parts department containing all parts on a given truck model. The 2nd sheet is exported as a database file from inventor and imported as an update able sheet in excel.
I am needed to compare part numbers between the 2 sheets and the qty of each. So far I have it where it matches the part numbers and turns the ones I don't have in the model red. Now I'm trying to match the part numbers and pull the qty of said part from sheet 2, the imported one, and compare it to the to the qty in the 1st. All I really need to accomplish is matching the part numbers then copying the qty from sheet 2 to sheet 1 onto a new cell of the matched part number.
View 3 Replies
View Related