Excel VBA - Fill known details based on USER ID - vba

On one sheet, #IDs, i have a list of registered users with different information on each column.
For example:
#user_id, #phone_number, #address ... (Each information is on different column). I take this information from an ActiveX Form when users are registering.
On a different sheet, i want people to enter their user_id ONLY, and based on the information on the #IDs sheet, auto-complete the other information (phone, address...). If not registered (=does not exists at the #IDs sheet, give nothing).
I would love to have some help on this small project.
Many many thanks!

Assuming your data is on Sheet1 and Lookup ID is in A2 on Sheet2, then try this...
On Sheet2
In A2
=IFERROR(INDEX(Sheet1!B:B,MATCH($A2,Sheet1!$A:$A,0)),"")
and then copy it to right.
Sheet1:
Sheet2

Related

How can I insert searchable data into one column, have it display linked editable data in the next?

I want to be able to put a students name or I.D., have google sheets search through spreadsheets for that student, then populate information in the next column (their phone number and current grade). The kicker is that I want to edit the populated grade and have it linked to the original sheet so it gets updated.
I have the current sheet called "UpdateInfo". All the other sheets are categorized by student name. In each students sheet, their names are in "A1", their phone numbers are in "B1" and their grades are in "C1". All student sheets follow the same format. I had a friend explain how VLOOKUP can find and populate the info. We have no clue how to link it and have it update once edited.
I want to open "UpdateInfo", insert names of all the students, have their numbers and grades populate in the next columns, then finally edit the information and have it also updated in the students' original sheet.
I'm not sure what you want, maybe you can take a look at the sheet as attched above.
The "data" sheet for you to store your students information,
the "check" sheet for you to find out the answers by select the student's name.
You can add as much as students you want at the "data" sheet,
it will all appear as an options in the "check" sheet.
https://docs.google.com/spreadsheets/d/1x8s36Ph20sjozOjuekJgH3-UMDz_kBicequaHrI8k8E/edit?usp=sharing
This is the link of the spreadsheets, which is supposed attached in the previous post...

generate a hyperlink in sheet linking to matched data found in a different sheet

I have two different sheets in a workbook with data, all of this data is organized by Site ID's. What I want to do is use these site ID's to create a hyperlink in one of the data sheets that when clicked takes the user to the corresponding Site ID in the other sheet. The sheet name where I want to write the hyperlinks to is called "Report_Manual" and I want to write hyperlinks down every row down the first column. The sheet that I am hyperlinking to is called "Data". The premise Ids are located in column C for sheet "Report_Manual" and column K in sheet "Data". Below is an a ttempt of what I was trying to generate in excel for a single cell formula however the issue I ran into for this formula is that the Premise ID's in sheet "data" are variant data type while the Premise ID's in sheet "Report Manual" are integer data type. This makes even a simple formula like the one below not get any matches as the data types being matched aren't the same.
=HYPERLINK("#"&CELL("address",INDEX(Data!K3:K580001,MATCH(C3,Data!K3:K580001,0))),C3)
If anyone has any idea of a macro to solve this issue that would be extremely helpful.
If the IDs in "Data" are text, try changing your match lookup value to text:
=HYPERLINK("#"&CELL("address",INDEX(Data!K3:K580001,MATCH(TEXT(C3,0),Data!K3:K580001,0))),C3)

Splitting data between worksheets depending on status of Column A

I have been asked to create a database of volunteers in Excel. The main worksheet (called Data) holds all the information – names, addresses, numbers, reference checks, placements, supervisors, etc. What I am trying to achieve is for the relevant information to be moved from one worksheet to another when the status of the person changes.
There would be 5 categories which the volunteers would fall under (column A labelled ‘Status’)
PROCESSING
ACTIVE
ON HOLD
BARRED
STOPPED/RETIRED
What I want to get is a live database so the information would appear on a relevant worksheet whenever the status on the main spreadsheet changes , but I only want some information to show depending on the category…
Each Worksheet would contain columns A-F from the ‘Data’ worksheet and in addition:
Processing would contain columns X-AE
Active: AF-AW
On Hold: AZ-BC
Barred: AX-AY
Stopped/Retired:- BD-BH
I have searched and searched again but I know nothing about Macros (and my IT department is unable to help) So my question is – is this doable and if so is anyone able to help me?
I hope I am making sense and if not I can email across the dummy database with some made up names to show what it is I am trying to create
You can do this using array formulae. This link shows a simple example which provides the basic formula (explained in detail in the linked article)
=INDEX(range,SMALL(IF(col=value,ROW(range)),ROW(1:1)),COLUMN(A2))
Where range is the range of all your data from your main worksheet and value is the value you want to screen for (this changes for each of your sheets) and col is the column on your main sheet that you want to check the values of. Note it is an array forumla so you have to press control+shift+enter after typing in the formula as explained at the bottom of the link.
You will notice that I have changed the formula to say COLUMN(A2) instead of 2. This is so that you can drag the formula across the columns as well as down the rows. You might need to make this COLUMN(A2)-x where x is an offset because your data don't start in column A.
Note that the same applies for the ROW(1:1) part, if your range doesn't start in row 1 then you will need to offset this by some value as well (i.e. something like ROW(1:1)-y)

#REF! result when using INDEX function in Excel

I am trying to create a couple of reports from data on another Excel worksheet based on the value in a drop down list. I am using the MATCH and INDEX functions and have created Named Ranges of the columns of data. I am able to get the first value I want in the report but none of the others, even though when I debug by evaluating the formula it points to the right cell but still displays #REF! instead of the actual value from the referenced cell.
I'll do my best to make this clear:
In "POST_Data" worksheet I have 4 columns titled Course Name, Course Length, Attendee and Date Attended. Currently I have 33 rows of data (plus the header row) but I need the reports to be dynamic since new data will be added from time to time.
I have created Dynamic Named Ranges of the data using the OFFSET function (e.g. for the Course Name data I have a NameRange called CourseNamesData = OFFSET(POST_Data!$A$2,0,0,COUNTA(POST_Data!$A:$A),1)
In the "DashBoard_and_Data Entry" worksheet I have a two report areas: one to report the Course Name and Date Attended for a specified Attendee (specified by a drop down list in cell C7) and the other report to provide the Attendee Name and Date Attended for a specified Course Name (specified by a drop down list in I7).
In row 8 I report the column that the data belongs to in the POST_Data worksheet
What IS working: When I choose an Attendee from the drop down list in C7, I correctly report the first of the Course Names for this attendee from the data in the POST_Data worksheet. I used the following formula to do so: =INDEX(CourseNamesData,MATCH(C7,AttendeeNamesData,0),B$8)
What is NOT working: The corresponding "Date Attended" data when I use a similar formula as the one that is working. I have: =INDEX(DateAttendedData,MATCH(C7,AttendeeNamesData,0),C$8) but this gives me the #REF! error.
Again, when I try to follow the data that this formula points to, it looks like it is pointing to the correct cell but not showing the result.
Another issue is how to get all the data corresponding to the choice in the drop down and not just the first row. So for example, if I choose Richards, K. from the attendee list and he has attended 4 training courses, I need all 4 to show up, not just the first one.
I appreciate any help or insights on this. If you know of a better way to display the workbook contents, please let me know.
Thanks!
Can you provide a screenshot so that I can better understand the issue?
With regard to your post_data worksheet, you might find it easier to turn the data into a table. You can then point your named range to the column within the table without needing to use the offset function, and your range will update automatically as you add to the table.
I have a entire playlist on my youtube channel devoted to using ranges and tables if you are interested. https://www.youtube.com/playlist?list=PL1nLTDk2QLL9415OPSjIICJs1EeV-HeK3

How to create a Dynamic Formula in a Google Spreadsheet based on a dropdown?

I have a Google Spreadsheet of containing an Employee Schedule separated daily (each date has its own page). I need to create a SINGLE summary page with a drop down that will change a formula and display the results. I currently have the formulas setup so that each employee has their OWN page depending on the employee number that shows a quick summary of when they work for the entire month. I would like to compress that into a single sheet with a way to dynamically choose from a drop down what name to see.
Here's a link to the sheet: https://docs.google.com/spreadsheet/ccc?key=0Amfumj1fHXzYdElQSGtqZkZ2aHAtdW4wM1d2WTZnMXc&usp=sharing
And here's a direct link: https://docs.google.com/spreadsheet/ccc?key=0Amfumj1fHXzYdElQSGtqZkZ2aHAtdW4wM1d2WTZnMXc&usp=drive_web#gid=34
I'm Looking to change Cell A1 into a drop down that when selected will change the 744 Formulas to look for the selected name.
Current formula: =IF((COUNTIF('1'!B3:P3,"Katie"))=0,"","XX")
What i would like to accomplish: =IF((COUNTIF('1'!B3:P3,"DROP DOWN SELECTION FROM A1"))=0,"","XX")
Dropdown will always be a text name (Bob, Sally, Dave R, Adam, Kat, etc)
Any ideas?
Have you tried?
IF((COUNTIF('1'!B3:P3,'1'!$a$1))=0,"","XX")
In this way you only need to change the value cell A1 of the sheet called 1.
As for a dropbox, DATA > VALIDATION
- Range '1'!A1
- Criteria, select LIST WITH ITEMS