Return Nth Lookup Occurrence
Aug 16, 2007
Is there a way to build a formula that looks up the first record in a table that has a value of A and X? Value =A Value=X. The next formula would would then return the next record that was a value of A with a value of x that was greater than or equal to 4?
Table
1 A x
2 A
3 A x
4 A
5 A x
The 1st formula would return a value of 1.
The 2nd formula would return a value of 5.
View 3 Replies
ADVERTISEMENT
Aug 15, 2008
I've found Nth_Occurrence and it's frankly brilliant but I need to be able to return the occurrence number of a value in a range and it doesn't quite do what I need.
Using = COUNTIF(A$1:A1,A1) gives me exactly the answer I need but as I'm working with big ranges it's taking a lot of calculation time.
View 9 Replies
View Related
Jun 5, 2008
I have a list of dates in column AF. I would like to retrieve a value from the 2nd occurrence of a date, so I used the function for the Nth Occurrence on this website as follows:
Function Nth_Occurrence(range_look As Range, find_it As String, _
occurrence As Long, offset_row As Long, offset_col As Long)
Dim lCount As Long
Dim rFound As Range
Set rFound = range_look.Cells(1, 1)
For lCount = 1 To occurrence
Set rFound = range_look. Find(find_it, rFound, xlValues, xlWhole)
Next lCount
Nth_Occurrence = rFound.Offset(offset_row, offset_col)
End Function
The excel formula I am using is as follows: =Nth_Occurrence(AF2:AF622,AE2,2,0,1)
Where AE2 is the date I am looking up. My question is this: When I put in a date ("1/12/2007") instead of AE2, i get the correct value. I tried giving AE2 and the AF column the same date formatting (3/14/2001), but this doesn't work. The date I am searching for also changes, so I cannot just type the date into the excel formula.
View 2 Replies
View Related
Dec 29, 2006
I am using vlookup to find the ORIGIN data and DESTINATION data but the subheading is the same for both- see below(site name, city...). How do I find the second occurrence for the same heading?
Is there another command that would be better?
col A col B
Line#1ORIGIN INFO:
Line#1 CONTACT NM
Line#1 CONTACT PH#
Line#1 CONTACT EML
Line#1 SITE NAME
Line#1 ADDRESS
Line#1 CITY
Line#1 ST ZIP CTY
Line#1 DAY&WINDOW
Line#1 LIVE/DROP?
Line#1DESTIN INFO:
Line#1 CONTACT NM
Line#1 CONTACT PH#
Line#1 CONTACT EML
Line#1 SITE NAME
Line#1 ADDRESS
Line#1 CITY
Line#1 ST ZIP CTY
View 5 Replies
View Related
Aug 23, 2007
I have a very very long weekly table of, say, sales regions, items sold, revenue, profitability, etc.
(Very long here means 120,000 rows, and in Excel 2007 - please don't hold this against me! )
Let's assume Row 1 and Column A are for headers. So Column B is Sales Region and Column C is Item Name. The first Sales Region, beginning in B2, let's call it "America", will repeat (B3, B4....) until the Item Names are done for that region. Then the next Region starts, "Australia", and the list of Items starts again, etc.
Not all the Items will be sold in every Region each week, and even some Regions may disappear from the table one week only to reappear a few weeks down the road. The table is Sorted alphabetically, though, first by Region, then by Item.
One way to VLOOKUP week over week information from last week's report onto this week's report is to concatenate both weeks' Region and Item information (=B2&C2) seperately, and VLOOKUP by that. This returns only combinations of Region/Item that occured in the current week, and with ISERROR, 0 for combinations that occured this week, but not last week. As far as what it returns, this is fine for our purposes but with several pieces of information to VLOOKUP (#, revenue, profit, etc.) and 120,000 rows, it takes forever. Literally over an hour to copy down the week over week parts.
I had the idea that maybe it would be faster if I could define individual VLOOKUP ranges for each Region, and then look up Item within that range. These ranges would vary in placement in the table and in numbers of rows each week, as the number of Items sold in each Region waxes and wanes, hence "dynamic ranges" - I hope I've used that term correctly.
Is there an effective, efficient way to return the row numbers of the first and last instances of a given Region, and use that range for the Item VLOOKUP?
View 9 Replies
View Related
Feb 14, 2014
accomplish VLOOKUP for multiple instances of a same Lookup value
First let me explain about my file:-
Table~1:-
1.B2:B19 I have list of items which required to build a product
2.D2:D19 I have list of shortages against each item
3.C2:C19 I have list of dates when each item shortage will get fulfilled
Table~2:-
1.C22:C31 I have picked the largest 10 different dates from Table1 by using LARGE formula.
Against each date which is update C22:C31, respective shortage qty has to get VLOOKUPED.
When there is a same lookup value, it has to keep pick next value (Shortage Qty) for same date.
View 2 Replies
View Related
Jul 19, 2007
Is there anyway that the UDF can remove duplicates? It's not a huge problem, but would make things a bit easier.
View 2 Replies
View Related
Dec 13, 2006
I need to know how to create a drop down menu from a very large spreadsheet of Column A but have it only return 1 occurrance. NOT in VBA.
Example:
Column A - these are different Value Streams PMV, SMV and WRV but this will show up over 100 times each as there are many departments per Value Stream I would only like to see 1 occurrance
Column B - Is a list of departments per value stream but will have duplicate departments Example: PMV - PM9, PMV - PMA, PMV - PMB
I would like to have a drop down and be able to select from the three value streams (Column A) and it return one occurrance then the departments that correspond with the Value Stream (Column B).
View 9 Replies
View Related
Dec 15, 2008
What Formula will return the above request (Preferable as "simple" as possible) ...
View 13 Replies
View Related
Jan 7, 2013
I am working with a data sheet that holds a cell containing a number of position entries with each entry separated by a carriage return within the cell. I need to determine the entry associated with Accountant. The formula below determines if the entry Accountant exists and if so, displays 14 characters of information starting after the 12th character. The entry after "Accountant" is variable, but will have a carriage return at the end of the line. How can I identify the placement of the carriage return after the Accountant: entry?
=IF(ISERR(FIND("Accountant:",'Dynamic Report - WIP HDCI-Qu~01'!G7)),"",MID('Dynamic Report - WIP HDCI-Qu~01'!G7,FIND("Accountant:",'Dynamic Report - WIP HDCI-Qu~01'!G7)+12,14))
View 5 Replies
View Related
Mar 14, 2007
I have multiple automatically updating data sets and I need to extract certain data to perform calculations on, this is the format of the data
SPLIT AB H 2B 3B
HOME 20 6 1 0
AWAY 20 7 2 0
SPLIT R HR RBI
HOME 2 0 1
AWAY 3 1 4
basically, what I need is to extract the data for home and away, and put them each on one line, no problem if this is always the format, but there are other lines of data that I don't need thrown in there at times which shift the data up or down
a simple vlookup will extract the first occurance of home, but I need another formula to extract the second occurance so I can have them all on one line and have the data as:
SPLIT AB H 2B 3B R HR RBI
HOME 20 6 1 0 2 0 1
AWAY 20 7 2 0 3 1 4
View 2 Replies
View Related
Dec 14, 2011
Is there a way to have a formula search an entire row containing certian text, for example "x" and have the formula return the letter of the first column that text is found?
View 8 Replies
View Related
Dec 24, 2013
I'm getting an export from a CDR. This export contains the date and times people log on and off from a queue. For logging in they dial 511, for logging out they dial 512. They get a voice prompt and type their password. I need to know how much time they daily spend in this queue
At first this looks pretty easy. I just make a sum of all the times they called to 511, then a sum of all time they called to 512 and finally I substract those values and I end up with the correct time spend in the queue.
The problem comes when they call multiple times to 512 without actually logging off. For example, they type the wrong password or simply hang up.
Result is this in the CDR
FROM TO DATE TIME
101 511 23/12 08:34
101 512 23/12 11:58
101 511 23/12 12:34
101 512 23/12 14:45
101 512 23/12 14:47
101 512 23/12 15:00
The actual time spend in the queue is 5 hours and 50 minutes. But Excel calculates this as 35 hours and 22 minutes, because it counts the 512 values no matter what.
How can I make sure that Excel only calculates the values of they are either the last value in the row OR if they are preceded by 511?
View 2 Replies
View Related
Dec 21, 2013
I have a value in $ED$1. This is Value X.
Row A = $DO$7:$DV$7
Row B = $DO$10:$DV$10
[Formula location = $EE$1]
Where Value X occurs in Row A, l want to return the parallel cell in Row B.
Both rows are sorted in numerical order. There is a slight complication though: Row A might contain multiple occurrences of Value X. If Value X is repeated several times in Row A, I want to find the left-most occurrence of Value X in Row A, i.e. the one closer to Column DO.
View 5 Replies
View Related
Oct 8, 2008
I have this vlookup formula and as you can see when I run it works good. The only problem is that I would like to have formula that it something is not found I don't get #N/A , but rather a 0 or blank.
=VLOOKUP(A6,GL!A$1:E$76,5,FALSE)
LOOKUPDIVDPTCC SALES 46120
010775010775 49,028,244.58
010200010200 3,373,145.76
010700010700 113,667.00
010300010300 14,382.54
011000011000 (1,518,076.05)
010600010600 589.98
011900011900 6,280.31
010900010900#N/A
011100011100 313.08
010750010750 570.90
View 5 Replies
View Related
Jun 15, 2009
Column A lists types of employees (managers, engineers, sales reps, etc.), each of which earns a seperate hourly rate. Column C lists hours worked, and Column D lists the total pay (Cx*Bx).
So column B is missing. Is there a way to generate the hourly rates in column B for each employee type in collumn A, i.e. if it's an Engineer, return $29, if it's a Technician, return $18, without an infinite set of True/Fasle conditions.
View 5 Replies
View Related
Sep 11, 2009
I have two files with the below data:
File A
Bob Jones
Williams, K.
File B
Jones, Bob
Williams, Ken
The only commonality between the two files is the last name. I can easily separate the last name off File B, since it is always 'last name, first name'. I want a lookup formula to use the last name from File B (after I separate it), lookup to File A, and if it finds a cell in a specified column that contains the same last name, return data from another column within File A.
View 3 Replies
View Related
Oct 13, 2008
I am trying to look up a value using VBA on 1 sheet and return it to a cell on another sheet.... I was hoping Evaluate sum product would work but I can't get it to. Basically I want to look up values in column C and D to locate the row then return value in column I specify.. below eg where Column C = SYD and column D = SHA, row = 6 .... value in L row 6 = 1
View 2 Replies
View Related
Sep 20, 2006
My Lookup formula gives back N/A rather than an empty cell. I was unable to find the solution in frequently asked questions. Everything points to using VLookup which I feel doesn't fit my situation as I am only looking at one row of text.
The length of my targeted range changes so I am wanting to use the lookup for an extra amount of rows to ensure I capture all the data at any given time. Once my lookup gets to the end of the list and finds a blank cell i get back N/A. I tried to include "" in my formula to combat this but it isn't working. I have been using IF statements elsewhere on my sheet but there are 30 arguments and I was forced to find an alternative.
This is an abridge version of my formula:
=LOOKUP(Data!A2,{"","0129","0133","0163","0167","0187","0197","0202","0212"},{"","0201-0129","0205-0133","0201-0163","0213-0167","0201-0187","0216-0197","0212-0202","0217-0212"})
Didn't know if I was supposed to use [code] for that. Figured better safe than deleted
View 9 Replies
View Related
Jun 17, 2008
I am trying to set-up a formula that will look up two different values of a grid (x & y) and the result will be the intersection of the two values (z). If there is not a value at the intersecting cell i will have it display "n/a". I have attached an example of what i am trying to do but i have no idea how to set up the formula. I forgot to mention that the index or chart above remains constant but the lookups do change. I believe i may have figured it out. Here is what i came up with for cell C19. Should i have done anything different? =INDEX($A$2:$E$8,MATCH(A19,$A$2:$A$8,0),MATCH(B19,$A$2:$E$2,0))
View 8 Replies
View Related
Dec 18, 2013
How to return the value of what i looking up. for example i want to find the value of A1 from a range of B1:B10 if A1 is B1 then it return the value beside B1 for example the value of B1 is C1
View 2 Replies
View Related
Apr 6, 2009
I have rows with text and numbers. In order to ensure that the numbers are accurate, I have a "QC formula" that calculates a check using all of the numbers from 1 row. The challenge is that the "QC formula" needs to vary depending on a text value within the row.
How can I lookup up the text value and then return the correct active formula for that row? I have too many differet text values to do a nested If statement. see simplified example below.
Condition ABCFormula' Needed based on Condition
Red123A*B*C
Blue123A+B+C
Green123(A+B)*C
View 13 Replies
View Related
Nov 19, 2008
Hi there, please can you help me transfer data from 1 spreadsheet to another (I have attached a file which has 2 sheets).
I am trying to populate columns G to L (sheet B) with data from column H (sheet A) - the lookup is between 'Material' & '7410','7090','7680','7060','8630','7580' on sheet B & material & plant on sheet A.
I have tried H&VLOOKUP & INDEX/MATCH but I keep returning a #N/A..
View 10 Replies
View Related
Oct 1, 2009
I have a worksheet with the following values:
header row 15 17 19 25 etc.
each column underneath the row will have a value of 0 or -1
A B C D E etc
1 15 17 19 25
2 0 -1 -1 0
3 -1 0 0 0
4 0 0 0 0
etc
I want a formula that I would put in each row that would return the value of Row 1 if there is a -1 below that value. So, in this example:
Row 2 formula would return 17,19
Row 3 formula would return 15
Row 4 formula would return nothing
View 9 Replies
View Related
Aug 7, 2013
I am trying to automate the account classification of credit card (cc) expenses. The problem is charges to USAirways will always have random numbers after the vendor name on the cc download. I set USAIRWAYS as a Travel Expense and a simple Vlookup will not work.
For example, let's say a data dump in column C of the CC:
cell C2 is USAIRWAYS 037232A49429
CeLL C3:
USAIRWAYS 037282hf39647
Cell C4:
Facebook A8476H4
In column E I have my simple vendor name. Column F as the Vendor Account. For example E1 is USAIRWAYS. F1 is Travel Expense. E2 is FaceBook. F2 is Marketing Expense
In cell D2 & D3 I want to return Travel Expense anytime the formula sees USAirways in cell C2 returning the answer in column F after matching w/ column E. In cell D4 I want to return Marketing Expense.
View 3 Replies
View Related
Jan 4, 2014
I have a list of names in sheet1 column A and 3 more list of names on sheet2, sheet3 and sheet3. What I'm trying to do is find a match for each name on sheet1 column A on the other sheets and depending on which sheet it was found, I need a specific value returned to sheet1 column B.
For example, if A1 was found on sheet2, then on B1 I would need to return the value "Morning" but if it was found on sheet3, then I need the value "Afternoon" and if found on sheet3 I need the value "evening" returned to B1 and then the same for every other name on the list found on sheet1 column A.
What I tried was this.
This goes in Sheet1 B1 (then I would drag it down to search for the rest)
=IF(AND(MATCH(A1,'sheet2'!$E:$E,0)),"Morning",IF(AND(MATCH(A1,'sheet3'!$E:$E,0)),
"Afternoon", IF(AND(MATCH(A1,'sheet4'!$E:$E,0)),"Evening","Un-assigned"))
Now the problem with this is that it only works if there is a match on sheet2 but if there is no match, it just returns "N/A" and it does not move on to sheet3 and/or sheet4.
I also tried with vLOOKUP instead of MATCH and the same thing happens.
I also tried this and the only thing I get is "Un-Assigned"
=IF(AND(A1='sheet2'!E:E),"Morning",IF(AND(A1='sheet3'!E:E),"Afternoon",IF(AND(A1='sheet4'!E:E),"Evening","Un-Assigned")))
View 3 Replies
View Related
May 12, 2014
I have four columns, Play Date, 1st, 2nd, 3rd.
I have a total of 364 rows of data for this table.
My output table looks like the following:
{mod note - HTML not working and removed}
What I want the output from a formula(???) to do is put every 'Play Date' for each 1st, 2nd, & 3rd column for every number from 0 to 9. So under Column A for zero and 1st I want every date that is listed in the source table in column 1st to list out. All I can get is the first instance of a date and nothing else.esn't use that would be great.
FYI the formula that I used to get the one entry in column A row 4 was this:
=INDEX($AK$4:$AK$367,MATCH($A$2,$AL$4:$AL$367,0))
View 2 Replies
View Related
Feb 10, 2007
I have a large set of numerical data, with each column having a text heading in the first row.
I want to use a function similar to HLOOKUP that can return the numerical value in a certain row of a column that has a specified heading....AND if there is more than one numerical value that meets the criteria, I want it to return the lowest numerical value.
My numerical data cannot be sorted into ascending order.
View 9 Replies
View Related
Mar 8, 2007
I have two columns of data, one containing Groups, another containing Items. Like this:
Group | Item
A | Apple
A | Orange
B | Pear
B | Banana
C | Tire
D | Coffee
etc.
On another sheet, I have each of the groups listed as column headings. I want to resort the data and display it in columns instead of in a single list.
I can write a VLOOKUP to search for "B" for example, and return "Pear", but I want to return all matches for "B" not just the first one.
View 2 Replies
View Related
Nov 22, 2007
I have a list of values in column A (part numbers)
In columns B to E I have lists of similar values (part numbers, with row 1 representing their location e.g warehouse, office, etc).
In column F2 I would like to search for the value in A2 in the range B2:E100 and return the value in B1:E1 if the value appears... if it doesnt appear in any of the columns I would like 'not located' to appear in F2.
I've been trying to do this for a while but am making no progress at all.
View 9 Replies
View Related