Fillng in excel cells automatically using data - excel

I am wondering if and how this can be done:
I have a spreadsheet that has three columns for Highschool name, State and CEEB code.
As of now, we have to manually look up the CEEB code and fill them in.
Is there a way i can give excel the entire list of all HSs and CEEB codes, so when I enter a High School and hit tab, it fills in the CEEB code automatically if it exists in the list provided to excel.

On a separate sheet, list the highschools and CEEBs. If you put the high school name in A1, put this formula in B1
=VLOOKUP(A1,Sheet2!A1:B100,2,FALSE)
with your high schools and CEEBs on Sheet2 and in the range A1:B100. Adjust to fit your actual data. If you don't have anything in A1 and don't want to see an error, use this formula
=IF(ISBLANK(A1),"",VLOOKUP(A1,Sheet2!A1:B100,2,FALSE))

Related

excel formula to return multiple results

I am currently using Index,Match to match records from one sheet to the other. Works great, except when I have multiple records with the same identifier. Let me explain:
The sheet named Open Leave Report contains the raw data (lookup values), while the sheet named Open Leave Capture contains the scrubbed data. So my formula looks like this
=INDEX('Open Leave Report'!O:O,MATCH('Open Leave Capture'!C9,'Open Leave Report'!B:B,0))
Works great, except when I have the following:
Column B Column O
Employee ID Continuous or Intermittent
1646484 Intermittent
1646484 Continuous
So when I type the Employee ID in the Open Leave Capture it always brings back the first row, but it ignores the second record. It looks like this:
Employee ID Type
1646484 Intermittent
1646484 Intermittent
Is there any way I can format my Index/Match formula to bring back both records?
I hope I explained this well
Don't use INDEX and MATCH for this...use PivotTables instead.
Whenever I want certain records from a list to appear in a different place, I turn my source data into an Excel Table, and make a PivotTable out of it, and then filter that PivotTable to show just the items I'm interested in.
No formulas, and as soon as you refresh the PivotTable it will automatically pick up any changes to your source data. Unlike formulas, which can be overwhelmingly complex to pick apart, and rely on you remembering to drag the formula down the page in order to ensure you capture any new data.
The solution is far simpler if you convert the source data into a table. Select the source data then use Insert > Table.
This solution has the following assumptions:
Source data has columns named "Employee ID" and "Type"
In the destination, the IDs to be looked up start from cell A2
In the destination, the values to be returned start from cell B2
This is formula to put into cell B2. This is an array formula. You need to double click into the cell, paste the formula, then save it by pressing CTRL+SHIFT+ENTER. You can then fill it down as far as you need to go.
=IFERROR(INDEX(Table1[Type],SMALL(IF(Table1[Employee ID]=A2,ROW(Table1[Employee ID])-ROW(Table1[[#Headers],[Employee ID]])),COUNTIF($A$2:A2,A2))),"Not that many")

Generate or fill cell data based on another dataset excel

I've a data set that shows;
employee name
date
time work started
time work ended
Now I am trying to have a report like sheet where I can select a certain employee name from a list of employees to view his/her time attended for a particular month.
I tried vlookup but went no where since I need to lookup by two columns plus a row.
Is this possible? without macros or vba.
Thanks
Since name and date are unique identifiers it is possible to use the sumifs function.
For ‘time in’ and ‘Rachel’ this will look as follows:
=Sumifs(column ‘time in’ from data set, column ‘name’ from dataset, “Rachel”, column ‘date’ from data set, “10/01/2017”)
Where Rachel and the date also can be a referenced cell.
=AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1)
The above formula will grab the row number that matches your criteria. to pull the information you want, you can place the row number inside an INDEX formula to get the following:
=INDEX(SHEET1!$D:$E,AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1),COLUMN(A1))
You can place the above in your first Time cell and copy right and down. You will see errors if criteria do not exist. ie no person of that name or no date data for that person. to avoid this you can wrap the whole thing in an IFERROR like the below:
=IFERROR(INDEX(SHEET1!$D:$E,AGGREGATE(15,6,ROW(SHEET1!$A$2:$E$22)/((SHEET2!$B$1=SHEET1!$B$2:$B$22)*(SHEET2!$A4=SHEET1!$C$2:$C$22)),1),COLUMN(A1)),"Nothing found")
if you would rather a blank than nothing found display change the "nothing found" to "" or 0 if you want 0 to be displayed.
Note: Aggregate is performing array like calculations in this case. As such you do not want to full column references as it will cause a lot of unnecessary calculations to be performed. Because you have unique entries, SUMIFS option given in another answer is a much better choice.
I think a pivot table will do the job for you.
Place the employee name in the filter, place date and
times in the rows.
Remove subtotals from the Pivot Table
Change Table layout to tabular and Repeat rows
Right click on the Time In and select Ungroup
Then you have the image below.
I have the following layout:
In B11 write this formula and drag down:
=INDEX($B$2:$E$5,MATCH($B$7&$A11,$B$2:$B$5&$C$2:$C$5,0),3)
In C11 write this and drag down:
=INDEX($B$2:$E$5,MATCH($B$7&$A11,$B$2:$B$5&$C$2:$C$5,0),4)
Note that these are Array-Formulas, so you need to enter them with CTRL + SHIFT + ENTER instead of the normal Enter.
You will get a #NV error if the employee hasn't worked on one of the dates A11 and A12. So you could surround the Formula with IFERROR to avoid this.

I want to be able to type a percentage into a box into excel, and have all data above that percentage pulled through, is this possible?

I don't know if this is possible or not but here goes, my spreadsheet is as follows:
I have 4 columns- Date, Location, People Attended, % Attended
Going down I have lots of rows with data in. Eg, Date, where the cinic was, how many people turned up, and the percentage of people who booked in to who turned up.
I already have all of this information, but I have been asked if we could have a cell in Excel (can be a different sheet if needed) where we could put in "<65%" and all rows with more than 65% would be pulled through, leaving anything below out. This number could then be changed to any figure we wanted. Is it also possible to have anything above the number we put in, to add the previous column of attended to a total sum?
I hope this makes sense and is formatted correctly, thank you for any help you can provide.
Actually, you don't need any new work! Just use filters (Data tab --> filter).
You can then easily use number filters to get what you are looking for. You can use equality and inequalities (greater/smaller than).
ok so this is what works and how you should do it.
Highlight column a and add a column.
Add a sheet and name it sheet2 (this is only for now, after you're done you can rename it).
in sheet2 B1 enter a criteria E.G. >65 (this will be the cell you'll enter the criteria).
Back to sheet1. In A2 enter =IF(COUNTIFS(E2:E2,Sheet2!$B$1&"%")>=1,COUNTIFS($E$2:E2,Sheet2!$B$1&"%"),"")
Copy past to all the rows that have your data
Back to sheet2. in column a starting at row 2 enter numbers from 1 to 100 each number in a separate row, like this A2-1, A3-2 and so on (this will identify the number record the formula should return, if you asume you'll have more then 100 records matching your criteria, add more).
In sheet2 B2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute ,2,FALSE),"")
In C2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute,3,FALSE),"")
In D2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute,4,FALSE),"")
In E2 enter =IFERROR(VLOOKUP($A2,Your table address as absolute,5,FALSE),"")
Now copy the formula down all the 100 rows
All the best, hope it works.
Feel free to ask

Relational coding

I have two Excel sheets. There are some materials with their prices in the first sheet and each material has a code. In the second sheet we have some products. Each product needs one or more than one material (as in the first sheet).
I want to connect these sheets. I should be able to enter the material code in the second sheet and the name of the material should appear automatically. Also I'm entering the quantity of materials for each product and the cost should be calculated too.
Note:
I'm a programmer and know that this is so easy to handle in Access. But I want to do it in MS Excel.
With a layout as shown in the example and the range in Sheet1 named array =VLOOKUP(A2,array,2,FALSE) should show in ColumnC the value from the Sheet1 cell immediately to the right of the value as specified in A2 (of Sheet2). The same formula in D2 with ,2, replaced ,3, should give the corresponding unit price, so appending *B2 should give the Cost. Both formulae may be copied down to suit:

How to mask accounts in excel sheet?

Im working for a bank where customer accounts with varied lengths need to masked in excel sheet.
Is there any macro or formatting method which could help me doing this?
Eg:
Cell No Value:
A10 46579094628
A11 NL6539123747796621
This would turn to
A10 46XXXXXXX28
A11 NLXXXXXXXXXXXXXX21
I want to keep 1st 2 digits and last 2 or 3 digits intact. Please advise.
Who is going to be using this spreadsheet?
I ask because you can certainly create a new column with values computed by manipulating the text in the account-number column and you can get it to look exactly the way you want. But then you'll have to hide the original column. That may be inconvenient because:
Harder to maintain. Who/how are new accounts going to be added?
How do you know users won't just unhide the column? Seems like now you've got a password to manage.
Are you sure bank officials are ok with this?
Option two is to create the spreadsheet by manipulating account numbers from an export from a more secure DB so that they never make it into Excel. Then you don't have to worry about passwords, hidden cells, etc.
If you're looking for a way to create a separate column with the mask you can use the following:
=LEFT(<targetcell>,2)&REPT("X",LEN(<targetcell>)-4)&RIGHT(<targetcell>,2)
Just replace targetcell with the cell containing the account number.
I'd then copy the formula down for the full column; copy and paste the formula column "As Value" and delete the original account column to remove the sensitive information. (These steps could be entirely automated in VBA but this is an easy solution.)
Mask by
=right(sheet_org!a1a;2) & left("XXXXXXXXXXXXXXXX";len(sheet_org)-4) & left(sheet_org!a1,2)
if sharing without original content, copy and paste to new spreadsheet by macro.
or get external data in new workbook pointing at sheet with masked values.
regards,
//t
If your value is in cell A10 then insert the following formula in any blank cells
=LEFT(A10,2)&REPT("X", LEN(A10)-4)&RIGHT(A10, 2)

Resources