Find and count each occurence of a name is column A then read a value from column B - excel

I need a formula that is beyond me and my Excel skills, I need to insert the number of times a match is found in column A into column C and then insert the total number of days for that person in column D. Can anyone help?

In cell C2:
=COUNTIF(A$2:A$6,A2)
In cell D2:
=SUMIF(A$2:A$6,A2,B$2:B$6)
See also:
COUNTIF
SUMIF

Have you considered using a pivot table? It's a little bit overkill but greatly simplifies what you want to do. Assuming your using Excel 2007:
Select the range of data including column labels.
Go to Insert->[Tables]->PivotTable.
In the dialog box that appears, select Existing Worksheet, choose a cell a click OK.
At this point, the PivotTable pane appears with your field names in one box and four other labeled boxes below.
Drag Name to the Row Labels box.
Drag Name to the Values box.
Drag Days to the Values box.
You're done!

Related

Excel: Extract data from well beneath unique identifier

I have a spreadsheet full of data (simplified example below) that I would like to extract the number in the well underneath of "Gimme the number" and paste it into a new column on a separate sheet (i.e. if "Gimme the number" is in G6, I would like to retrieve the value for G7). I do not have access to Excel VBA and have not used macros in the past. I found some examples linked below, but, from what I understand, they would return "Gimme the number", or "Gimme" not 19, 20, and 21. I am not sure if a pivot table is appropriate, because I only want information from a single column. I will only have up to 11 values to extract at any given time, so I think a formula would do it. I am just having a hard time coming up with one that works. Any help would be greatly appreciated!
Search for a text string and return multiple adjacent values
Return multiple matches with wildcard vlookup
I am not sure I get the question well, but I try.
First add a column right of the column with "Gimme..." values. Name it e.g. "Next_value" in the first row. Put in the formula referencing previous column next row. If "Gimme..." is in the cell (for instance) E6, than your formula in the cell F6 is =E7. Copy that formula into the whole Next_value column.
Than select area of these two columns (Label, Next_value) and apply the filter from the Data toolbar. Use the small buttons with triangles at the top of the column Label to adjust the filter so only "Gimme..." rows are filtered.
Now, copy values of Next_value column where you like. If you want just the references, use Paste special function from the Home toolbar and click Paste link button.

Structured references vs explicit cell references

I'm using Index-Match to match Full Names with head count in that party.
I have it working but it uses both the structured and explicit cell reference.
I can't figure out why when I add a new row in my table, the column with the index-match formula wont populate the last row.
This is the formula used:
=IFNA(INDEX(AA:AA,MATCH([#[Preferred Seating 1st Choice]],D:D,0)),"")
Column AA has the head count number and column D has the list of full names.
Preferred Seating is the column used to reference the search.
I looked around and can't seem to find why it wont fill in the last row after that rown info is entered.
I can only assume it has something to do with the mixed Explicit-structured cell/column references. Any help please.
Yes Excel may not automatically assume a formula needs to be automatically filled in an entire table column if it contains unusual references. Unless you have data outside the table, you should just refer to the columns in the table:
=IFNA(INDEX([Column AA Name],MATCH([#[Preferred Seating 1st Choice]],[Column D Name],0)),"")
These can be easily entered when editing the formula by selecting all cells in the source columns excluding the heading. The formula will always use the entire
source columns and the formula should automatically fill its own entire column.
You can also control whether a column automatically has its formula updated through a hidden property. The ability to change the behavior of the column only appears through the front end when you're making changes to the column.
After entering a formula in a column, Excel will either automatically fill the entire column and give you the option to turn off the automatic fill, or Excel will not automatically fill the entire column and give you the option to turn it on.
After entering a formula that isn't being filled, this icon will appear:
Click it and then select to Overwrite all cells in this column with this formula
Deleting a formula from one cell in a column that is being automatically filled will turn off the automatic fill. Double clicking a cell with a formula and pressing enter will give you the option to turn it on again.

How to program excel with vlookup function

I have this excel file with two sheets. Sheet 1 is the page where all of the part numbers and descriptions are placed. Sheet 2 is a database set into two columns one with part numbers the other with the description.
I have been looking into vlookup within excel and in which case i have it working with the part numbers so when i enter the part number or choose from drop down it will auto populate the description for me. The issue I am having now is that when i enter the part number it doesn't auto populate the description column until i double click the cell with the formula and hit enter.
I also want to do a reverse lookup from the description side where it will auto populate the part number as well.
Here is my formula I used for the vslookup.
=VLOOKUP(A9,Database!$A$1:$B$250,2,FALSE)
I came up with this formula after researching how to do it but I had to change the A9 portion to each row number ie. row 9, row 10, etc..
If you want to do a reverse lookup then vlookup will not work as it only works left to right - unless you repeat the data in column A in column C...
However, the more elegant solution is with index() and match().
=INDEX(Database!$A$1:$A$250,MATCH(B9,Database!$B$1:$B$250,0))
Not tested, written based on the info you gave in your vlookup, match will find the position of the item looked for and then index collects the result at that position in column A.
The beauty of index/match is that the columns don't have to be next to each other AS LONG AS THEY ARE THE SAME LENGTH...
Try right clicking the numbers column > format cells > format as text (by choosing "text" under the categories box). Hopefully this will make the auto populate work.

Trying to select rows that matched in vlookup excel

I am trying to select the rows of the results from my VLOOKUP and put the results in a neat table in another sheet. The row in my "M" column has a lot of NA and random numbers that were matched.
See this image for clarification:
I want to select all the rows that returned a result and move those rows to another sheet in a table without blank rows between the results. I am not sure how to do this but I know a resident stackoverflow pro probably thinks this is cake. Thanks for the help in advance!
You could make use of a filter:
Select your table and put a filter (under Home tab, Sort & Filter).
Uncheck the #N/A in the selection filter (click the little grey box with black arrow for the column where there are the #N/A that appeared when you inserted the filters).
Copy and paste everything you need into the other sheet.
You can do this with some formulas:
In the column next to your VLOOKUP (I assume it's column C) place a 'counter formula'- in D2, place =IF(ISERROR(C2),0,1), in D3 and below: =IF(ISERROR(C3),D2,D2+1)
Create a new table (say in starting in column F in the same sheet)
In the first column of the table, just place increasing numbers (e.g. in F2: =ROW()-1)
In the next columns, use INDEX/MATCH to retrieve the results, e.g. in G2: =INDEX(A:A,MATCH(F2,D:D,0))
Done!

How to create dropdown with multiple columns in excel

!
Hi I am using Excel 2003. I need to add data validation to a column, it should display the two columns in the cell, when user selects, the 1st column value should be displayed in cell.
Ex:
Col1 Col2
IND India
CHI China
Column - display to select
Column
IND-India
CHI-China
after selecting CHI the China or CHI will be displayed in the cell.
Is there any possibility to do the process in Excel.
Thanks in advance for any help...
(1)
If you need a dropdown item to display a different title after being selected, you can have another cell serve as the display. For example:
Where B3 (the helper cell) can have a formula like =LEFT($C$3,3) or use INDEX/MATCH to look up keys (like in your 'For Validation' table).
And where C3 (the data validation list) has a custom format like ;;;"(Change)" or "(Select)" or even a symbol like "↓", and will never display the actual selected list item.
You can also do this with VBA by creating an activex combo box control.
(2)
If you need one dropdown list to depend on the selection made in another, you can use dynamic dependent data validation:
http://www.myonlinetraininghub.com/excel-factor-19-dynamic-dependent-data-validation
Go to Devloper tab - insert - active control- insert comobobox
draw comobox in your excel sheet
right click on combobox, open property
in listfill range, type range of your column
set coloumn count = 2
change the widht of colomn
You can use the dropdown menu for the first column and the VLOOKUP function for the second column.
VLOOKUP would look at the first column and based on what's there would fill the second with the data from somewhere else.
I've also found a YouTube tutorial on how to use the function. Here you go:
https://www.youtube.com/watch?v=-WAEzokHSJM

Resources