I've recently started working with Excel due to running my own business now. As with anything I do, I want my logs to be practical, efficient and most of all working correctly. I'm almost satisfied with what I got so far but I can't seem to figure out how to let Excel look up a customer ID.
Basically what I want is:
In the first sheet I add a customer by name in column B, his assigned customer ID is in column A
In sheet 2 I type in the name of the customer in column E and I want Excel to look up that lastname in sheet 1 and then add the related customer ID in sheet 2 in column A
The reason for this is that I have returning customers and I don't want them to have a new customer ID, I want them to have the same ID as they had previously without going through all my customers to look if they are a returning customer and if so what their customer ID is.
I've been playing around with the INDEX function as that seemed to be the function used for this kinda stuff, but I just can't figure it out.
I look forward to hearing your tips and tricks in regards to this issue, thanks in advance!
Marc
In Sheet 2 A2
=INDEX(Sheet1!A:A,MATCH(E2,Sheet1!B:B,0),1)
This answer would work for you assuming Sheet1 stores ID in A, name in B, and your second sheet has you type the name in E.
Caveats being that matching based on typed names are extremely prone to error, it would have to be an exact match. Perhaps consider using data validation or a more robust solution in the medium term.
Related
As you could probably already guess, I am working on a report summary that displays the amount of time each agent has spent in different statuses such as 'Available', 'Unavailable', 'In a meeting', etc. that can easily be modified and doesn't rely on specific criteria, just the table rows & columns. For example, if someone was to switch teams or get a new supervisor, the data would be updated automatically when replacing the supervisor name.
The issue that I am having is when I try to use a VLOOKUP in my 'Report' sheet to match an agent's User ID to their supervisor in the 'Agent List' sheet, I am getting #N/A as my result.
This is the function that I have tried:
=VLOOKUP('Agent List'!C2, 'Agent List'!A:D, 4, FALSE)
As far as I know, I have met all the required arguments by stating where the data is stored by using 'Agent List'!, the look up value, the table array, which column to match it to, and whether I want an exact match or approximate match.
I have played around with the function for a while, and have looked at others posts, but was unable to resolve the issue on my own. Any help I can get with this would be great. Any suggestions on a better idea to achieve the same result are also welcome.
Thanks,
TNA
Agent List table example:
#N/A in a vlookup sense usually means the value was no found.
This is due the the data not being in the first column of reference.
Also are you trying to lookup the data from one sheet to another? The value you are looking up should be the first value in the formula. You appear to be looking up from the same table you are returning result from.
Instead you can try:
=VLOOKUP(OTHERSHEET C2, 'Agent List'!C:D, 2, FALSE)
OR
=INDEX('Agent List'!D:D,MATCH(C2,'Agent List'!C:C, 0),1)
Although I have some experience in VBA I still consider myself a novice. Just something to keep in mind.
I have a monthly report of a workbook with three worksheets that I am writing a macro for to combine and restructure the file for the output. My issue is that I have data in one column that contains information that I must extract some text, change the case and write back to the same cell. The text is, generally, a company name which will not start in the same location from company to company. Since VBA does not use wildcards (something I am accustomed to) I am finding it difficult to formulate a means to attain my task. I thought, once I located the 'name' I could reference a table and extract the modified name I need and rewrite to the cell. Here is an example of some input:
Col A Col B Col C
ASTRO #256 ASTRO Astro
DEBIT PURCH VISA CHEVRON 02 CHEVRON Chevron
SMART FOODSERVICE SMART FOOD Smart Foodservice
The value in column B is what I need to find in Column A and then take the value from Column C moved to Column A
I know I can do countless IF ELSE nests but I would rather have a separate table of col B and C in which to add new accounts as they arise. But that would require the code to be generic enough so the only updates are to the table and not the code. I understand I may be forced to do both but I suspect there is a more efficient way to do this.
Any thoughts? Thanks, Jeff
I am really having troubles with this one:
In one column, I have a long list of company names. The company names appear several times (based on how many tickets they have raised, but that is another story).
I am now looking for a function that would give me the Company name that occurs the most often. In the Cell below I would like to get company name that occurs the second most often. In the Cell below the company that occurs the third most often end so on and so on.
I thank everyone who is spending some time to help me figure this out.
Stephan
Make a PivotTable out of the data. Put the field of interest in it as both a Row Field and as a Values field, and make sure that the aggregation being applied is a Count. (It will be by default if your things are text).
See my answer at Excel, i have a big list (44000 records), i would like to sepperate them into 2 lists, 1 with unique values and 1 with duplicate value's
I just stuck with my school homework, it seems easy, but there is always different errors and mistakes.
Context
All I need is to connect information from 3 pages.
The first one is timetable of trainings.
The second page is "groups"
Players page
Question
1) Here is my first question. How I can put the time from the "timetable" page ?
I tried vlookup with the easiest group "children 5-7" but even this doesnt work.
The problem is that there is many possible times of some groups and I need the answer like "17:00, 18:00 etc" then.
2) The second question is with the page "players".
Firstly I need to match group or coach from page "groups". For children all is simple, but excel dont want to work even with this. But, there is one problem more. In adult group there cant be more than 4 players in one group, that why I have TK1, TK2, TK3 and TK4 - all this are for adult A. and TK11, TK22 etc are for adult B. So when its done we should match court and time from page "groups".
There is my spreadsheet so be free to try it right here. Hope you will help me!
Ref
https://docs.google.com/spreadsheets/d/1PNp60xmHOx_Q1wBc33WrzIaWmeNG5UMhi-4roV7dJXU/edit#gid=1868650910
I try to give you some ideas about how to solve your issues
Question 1:
The issue you have with VLOOKUP is that you cannot search on the left of your lookup value in the reference table. As suggested above by BruceWayne, you may use INDEX/MATCH. Considering the structure of your data a good formula could be:
=INDEX('timetable try here'!B:G,MATCH(A2,CHOOSE(B2,'timetable try here'!C:C,'timetable try here'!D:D,'timetable try here'!E:E,'timetable try here'!F:F,'timetable try here'!G:G),0),1)
In fact I am using CHOOSE() to select the column where your case should match, because your courts are numbers from 1 to 5. You may replace this formula in the column D under the label Time in your sheet named "groups try here". By the way the result that you get is only the first occurrence (in case you see a zero with some decimals figures, remind to change format to hours), so you will not be able to get the list as you like. As far as I know Excel does not have such kind of formulas. What you could do is create a VBA formula by yourself. You can find more details in this other post always here in StackOverflow, where I replied to a similar question with some code. I believe that your case is exactly the same.
Question 2
In this part I just added the last argument to the VLOOKUP and your formula works. So the correct formula should be in cell E2 of "players try here":
=VLOOKUP(D2,'groups dont try here'!A2:C15,3,0)
and in cell F2 (Court) of the same sheet:
=VLOOKUP(D2,'groups dont try here'!A2:C15,2,0)
I believe you need also a formula to pick-up the time in cell G2 (time):
=VLOOKUP(D2,'groups dont try here'!A2:D15,4,0)
These formulas of course works with suitable groups starting with "children". For the others it is not very clear to me what you need. If you have grouped all TK in Adult A and Adult B you need to have some criteria to fill in the other cells from your sheet 'groups dont try here'. Also remind that if you recode the TK1 and TK2 (for instance by adding a new column to be used as key for the VLOOKUP), with VLOOKUP you will always pick up only the first occurrence in the table.
If you need more support, please leave a comment.
any help would be massively appreciated - I'm really stuck on this.
I have a field on a user entered form that asks people what university they've attended which, due to technical limitations on our system, has to be free text.
This invariably leads to hundreds of different entries for each university, which means I have to use filter on excel and comb through thousands of entries and manually unify - lack of knowledge on how to automate this limits it's practical use massively.
Does anyone know a way we can automate this process of categorizing (and then unifying) different entries which refer to the same thing (e.g someone might put UCL, another might put "university of college, London" and another "university of college london" - I need to teach the system that all 3 are the same and then convert it on excel).
I have a list of the exact entries we want for each university, and I'm happy to manually 'teach' excel when a user entry matches one of these, providing it then learns this for the future (so as time goes on, we have to less and less manual unifying).
Happy to clarify anything, and thanks so much for any help.
Rob
Don't become the victim of user mischief.
Assign a unique ID for each valid response and have the users enter the ID.
Yup...
As you said, you need to do some teaching, here's is the teaching table. Basically just fill up as you go along. You might ask what is UOL, sorry i just crack it out, just for illustration.
And then you have the users inputs (column E), plus 5 calculated columns (F:J)
And now the formulae, I'll show those in row 2 only, the rest are just filled down.
F2 = SUBSTITUTE(E:E," ","*")
G2 = VLOOKUP(E:E,A:B,2,0)
H2 = COUNTIF(A:A,F:F)
I2 = VLOOKUP(F:F,A:B,2,0)
J2 = IFERROR(G2,IF(H2=1,I2,IF(H2=0,"Never seen before","Need validation")))
Basically the logic flow is
do the exact match vlookup of user input in teaching table, if found, then thats it and return the unified name. (Column G)
if the above exact match not found, then we'll proceed to use the star like Helper vallue. Count how many times the HELPER value is found in the teaching table. (Column H)
do the exact match vlookup of helper value in teaching table. (Column I, for use with Column H)
If value in column G is not an error, then use it,
else if value in Column H is 1, then VLOOKUP(HELPER) value is good. If its 0, then you haven't teach excel on the name before. If >2, then it means it need your further attention, the VLOOKUP(Helper) value could be wrong as there are more than one matches.
The trick here is the HELPER column. by replacing blank space with stars, the vlookup now become some sort like vlookup of a sequence of keywords. Doesn't matter how the user's input is, as long as some keywords found and the sequence match, the countif and vlookup return the value.
And at the same time, you also submit an IT enhancement request ! :)