Excel to find value from one sheet & show to another sheet - excel

I have a sheet1 where column A= employees name & column B=Status (present, absent, etc), I prepare Daily attendance in each sheets, so I have 31 sheets in a month. Now I have a new sheet November. in this sheet column A is employees name and column B, C, D, etc for each days status. show me status of each employes in each days B, C, etc

You would use the VLOOKUP statement to fetch the status from the other sheets.
This is in the format:
vlookup([cell which has the value you want to lookup], [range of cells which contain the table], [column you want to return from that table]). Hopefully this is explained in the example below:
For ease of explanation, imagine your sheets are named Nov1, Nov2... Nov29, Nov30 and NOVEMBER.
Nov1:
A B
1 Employee Name Status
2 Albert Present
3 Brian Absent
4 Catherine Present
5 David Present
6 Edward Present
Nov2:
A B
1 Employee Name Status
2 Albert Absent
3 Brian Absent
4 Catherine Present
5 David Absent
6 Edward Absent
Then, in your sheet NOVEMBER, which is the month summary, use the formulae:
A B C
1 Employee Name Nov 1st Nov 2nd
2 Albert =VLOOKUP($A2,Nov1!$A$2:$B$6,2) =VLOOKUP($A2,Nov2!$A$2:$B$6,2)
3 Brian =VLOOKUP($A3,Nov1!$A$2:$B$6,2) =VLOOKUP($A3,Nov2!$A$2:$B$6,2)
4 Catherine =VLOOKUP($A4,Nov1!$A$2:$B$6,2) =VLOOKUP($A4,Nov2!$A$2:$B$6,2)
5 David =VLOOKUP($A5,Nov1!$A$2:$B$6,2) =VLOOKUP($A5,Nov2!$A$2:$B$6,2)
6 Edward =VLOOKUP($A6,Nov1!$A$2:$B$6,2) =VLOOKUP($A6,Nov2!$A$2:$B$6,2)
Using the $ symbol will mean you can copy down the column and the formulae will update automatically. Ensure that the list of employees in your separate daily sheets are in alphabetical order.
So this should result in something like this:
A B C
1 Employee Name Nov 1st Nov 2nd
2 Albert Present Absent
3 Brian Absent Absent
4 Catherine Present Present
5 David Present Absent
6 Edward Present Absent

Related

How to check if a record exists based on month and persons name (where the name is duplicated)?

I have a data-set with some names and months, sample:
Name Month
Max 2
Sally 5
Max 1
James 11
Richard 9
Sally 9
I then have a table as such:
Month
Name 1 2 3 4 5 6 7 8 9 10 11 12
Max
Sally
James
Richard
How do I create a formula that can enter "Yes", or "No" for each month based on the person's name? For example, Max would have months 2 and 1 displaying "Yes", all other months displaying "No".
I can't think of how to do this...using an INDEX/MATCH function I can pull up the first month for "Max", but it won't register the second time his name shows up (it just matches the order of his name with where his data lies in the array, doesn't consider duplicates).
Is there a way to do this?
Thanks.
Assuming a data setup like this:
In cell E3 and copied over and down is this formula:
=IF(COUNTIFS($A$2:$A$7,$D3,$B$2:$B$7,E$2),"Yes","No")

Excel INDEX MATCH when one of multiple criteria is within a range of numbers

To identify duplicates in a large list of personal records, I'm replacing all names with a CONCATENATE of Name and Date of Birth (DOB). Here is the sheet I'm referencing (DOBs!):
DOBs! -----------------------------------------
C D E F G I K
Name Years Start End # Yrs DOB NewNameDOB
Sally Adams 2014-2014 2014 2014 1 1968-1204 Sally Adams1968-1204
John Agnew 2014-2014 2014 2014 1 1979-0419 John Agnew1979-0419
Bob Anderson 2013-2014 2013 2014 2 1965-0402 Bob Anderson1965-0402
Antonio Andrews 2014-2014 2014 2014 1 1955-0716 Antonio Andrews1955-0716
Julie Assan 2012-2014 2012 2014 3 1978-0805 Julie Assan1978-0805
On the main sheet (Employees!), each person has a row of data for each active year. Work 14 years, you have 14 lines of data to track.
Employees! -----------------------------------------
C D **E** F G H I J...
Year Name NewNameDOB Dept
2013 Julie Assan Julie Assan1978-0805 East
1998 Mike Rogers Duplicate in Same Year Main
1999 Mike Rogers Duplicate in Same Year Main
2000 Mike Rogers Mike Rogers1969-0510 Main
2001 Mike Rogers Mike Rogers1969-0510 Main
As mentioned, I need to separate duplicate names from 10395 records (like Mike Rogers and Mike Rogers). Employees! column E will now identify the employees as Julie Assan1978-0805 and Julie Assan1980-0131 (for example).
Today we take my first step, using the years they worked in order to solve 99% of the duplicates. After this, only a few duplicate names will be left who worked at the same time as each other, which I'll have to handle manually.
If the Employees! sheet has a 2013 record for "Julie Assan," then the first step is to check DOBs to find any Julie Assans who worked in 2013. My new column E in Employees! will take the current 2013 record of Julie Assan, and find any matches in DOB! where C (name) matches Julie Assan, E <= 2013, and F >= 2013. Usually, there will be only one match, and it will tell me that is Julie Assan1978-0805. Sometimes, there will be two Mike Rogers who worked during the same year, and it should tell me "Duplicate in Same Year".
On the Employees! sheet column E, I've started with this...
=index(DOBs!$k$2:$k$10395,match($d3&$c3,DOBs!$c$2:$c$10395& ??? ,0)
Not sure where to go with this formula, whether that means adding "IFs" or something different.
edited to explain in great depth
=IF(COUNTIFS(DOBs!C$2:C$10395,Employees!D2,DOBs!E$2:E$10395,"<="&Employees!C2,DOBs!F$2:F$10395,">="&Employees!C2)>1,"Duplicate in Same Year",INDEX(DOBs!K$2:K$10395,MATCH(TRUE,IF(DOBs!C$2:C$10395=Employees!D2,IF(DOBs!E$2:E$10395<=Employees!C2,IF(DOBs!F$2:F$10395>=Employees!C2,TRUE))),0)))
Enter as an array formula by confirming with Ctrl+Shift+Enter, then autofill down. It first checks for duplicates using COUNTIFS, and returns "Duplicate in same year" if it is. If there are not duplicates, it uses INDEX/MATCH to find the NewNameDOB.

Count X records matching certain conditions and only where there is a corresponding Y record

I am looking for some help with a formula. On my 'data' sheet, I have data in the format below:
A B C D E F G H I J
1 UID RecordType HCode AdmittedDate Forename Surname DOB Sex STDate RDate
2 87962 STAsses STIV1 01/01/2012 Mark Jones 13/07/1978 Male 09/12/2012
3 89658 Transfer GLSI2 01/01/2012 Alison Aitken 20/12/1956 Female 08/07/2013
4 84563 Discharge JHOP1 01/01/2012 David Beckham 09/08/1987 Male 08/07/2013
5 89654 STAsses STGE1 01/01/2012 Andrew Macbeth 27/09/1976 Male 08/07/2012
6 89867 Transfer KIND1 01/01/2012 George Deas 08/05/1989 Male 08/07/2013
7 87962 Transfer STIV1 01/01/2012 Mark Jones 13/07/1978 Male 04/03/2013
8 89654 Transfer STGE1 01/01/2012 Andrew Macbeth 27/09/1976 Male 12/08/2012
On my 'report' sheet, I have the following table set up:
B C D E F
4 HospCode RecordType Jul-12 Aug-12 Sep-12
5 STGE1 Assessments
6 Transfers
7 Discharges
8
What I need is a formula in cell D6 of the 'report' sheet, which counts all 'Transfer' records from the 'data' sheet, occurring in the month specified in D4 and with an 'HCode' matching that in B5 of the 'report' sheet. The tricky part is that I need this formula only to count records which have a corresponding 'STAssess' record.
Might be pushing the limits of Excel here, but anything is possible!
Thanks in advance.
You can simply use
=COUNTIFS(Sheet1!B1:B8, "Transfer", Sheet1!C1:C8, Sheet2!B5)
This is an example with 2 criteria, you can add a lot many more for multiple IFS and COUNTIFS will count those.
In case of finding multiple criteria across rows, you are better off making a Pivot Table out of this data range and then doing multiple selections thereof.
If you would like to accomplish this via formula, there is a two-step process.
THe formula described above needs to be placed next to each Person's name in Sheet1 as an additional column. And then run another COUNTIFS on this column and Column B counting that there is >1 Count for the person existing... and counting if the STAssess criterion is fulfilled or not.

Excel - Counting unique records in a group

I'm having difficulty counting records in a file that have a unique ID and listing the number of rows associated with that specific ID.
For this file, the unique ID represents a specific family (column A). Each member of the family is in a different row with the same ID. I would like to count the number of family members(rows) in each unique family. I can have a few thousand rows so automating this would be wonderful. Thanks for any help!!
You can do this now automatically with Excel 2013.
If you have that version, then select your data to create a pivot table, and when you create your table, make sure the option 'Add this data to the Data Model' tickbox is check (see below).
Then, when your pivot table opens, create your rows, columns and values normally. Then click the field you want to calculate the distinct count of and edit the Field Value Settings:
Finally, scroll down to the very last option and choose 'Distinct Count.'
This should update your pivot table values to show the data you're looking for.
So if I'm understanding you correctly, you have something like
A B C
Fam. ID LastName FirstName
1 Smith John
1 Smith Mary
1 Smith Johnnie Jr
2 Roe Rick
3 Doe Jane
3 Doe Sam
and you want a new column (say, D), with a count of members per family:
A B C D
Fam. ID LastName FirstName Fam. Cnt
1 Smith John 3
1 Smith Mary 3
1 Smith Johnnie Jr 3
2 Roe Rick 1
3 Doe Jane 2
3 Doe Sam 2
This will do it -- insert at D2 and drag down:
=COUNTIF(A:A,A2)

Count names one time (per year) regardless of how many there are by year

The problem is:
There is a table that gets data added to it each month. I use this data for many different pivot tables and reports, so I am not able to modify it. The user has requested that if its possible (and I assured him that it was) he would like to see two (2) single values of This Year and Last Year Doctors on the list.
The data looks something like this:
Doctor, In/Out, Date, Number
John Deaux Out 10/1/11 8
John Deaux Out 11/1/11 3
John Deaux Out 01/1/12 5
John Deaux Out 05/1/12 3
John Deaux Out 09/1/12 1
Billy White In 02/1/12 2
Mike Adams Out 06/1/11 6
Mike Adams Out 10/1/11 9
Mike Adams Out 01/1/12 1
Mike Adams Out 04/1/12 6
I would have 1 John Deaux for 2011, and 1 for 2012. The same for Mike Adams.
TY 2
LY 2
Now I only have to count the "Out"(s), so I have to be careful of that. Also, there is the chance that I would have to build this for the previous 12 months as well making it that much harder.
1 for John Deaux for the previous 12 months.
TY 2
LY 1
*TY: This Year - LY: Last Year
To do this manually:
Since you can't make any edits to the existing table, copy everything to a new table.
In the new table, add a column called Year. Use the Year() function to get the year out of the date cell.
Make another column called Count. Use If(A2="Out",1,0) where A2 is the cell in the In/Out column.
Copy the Doctor, Year, and Count columns to a new table.
Excel 2007 and above has a convenient tool called Remove Duplicates in the Data ribbon. Use that to remove the duplicates. This will keep you from counting a single doctor twice in the same year.
Create a pivot table, using Doctor as the row, Year as the column, and sum(count) for the value.
Check this, this will check the B column for the year 2012/2013 and count the distinct unique values in column A.
=SUM(IF(FREQUENCY(IF(YEAR(B1:B11)=2013;A1:A11);A1:A11)>0;1)) + CONTROL + SHIFT + ENTER
=SUM(IF(FREQUENCY(IF(YEAR(B1:B11)=2012;A1:A11);A1:A11)>0;1)) + CONTROL + SHIFT + ENTER

Resources