I have an Excel table (which is formatted as table and named as "table 1"). So the table columns are named like #LastName, #FirstName and so on.
This table contains information on when people attended a seminar. They're able to attend a number of seminars but also can attend a single seminar twice or more often.
I now want to find out, when the last date was , when a person attended a special seminar.
Lets give an Example:
Table:
#FirstName #LastName #Seminar #Date
Frank Mayer Workshop 1 2017/01/15
Frank Mayer Workshop 2 2019/05/27
Sabine Adams Workshop 1 2017/01/15
Volker Mueller Workshop 1 2017/01/15
Frank Mayer Workshop 1 2018/04/23
As you can see from this simple example, Frank Mayer attended Workshop 1 2x. All others attended each Workshop only once.
Goal is to have a list of Name, Workshop and last attendance. So the final list should look like:
#FirstName #LastName #Seminar #Date
Frank Mayer Workshop 2 2019/05/27
Sabine Adams Workshop 1 2017/01/15
Volker Mueller Workshop 1 2017/01/15
Frank Mayer Workshop 1 2018/04/23
I really have no idea how to solve this with Excel Formulas, since there is not only comparing dates, but also find double entry which differ only with the date. If possible, I'd like to NOT use VBA programming.
Do you guys have any idea? My table has 1500 lines, so doing that by hand is not an option...
Maybe there is a way to create a new sheet or table with the results?
Best Regards
Olaf
A more dynamic approach
(i.e. you would not have to go through the entire process each time more data is added.)
Add a helper column with name+last name+workshop per cell named e.g. "ID". Use either Concatenate or =Name & Lastname & Workshop to consolidate
Create a pivot table from your table with the following field-list:Rows: Add "ID" , Values: Add "Date" and change the value field settings (right-click) to "Max of Date"
Remember to refresh the pivot table when adding new data or change the pivot settings to update automatically when opening the workbook.
There are a thousand and one ways to do this and you might be surprised how easy it is to do manually too.
If you're reducing the table, meaning, removing rows from the table; then you could...
Add a helper column which concatenates the first name, last name, and workshop.
Then sort by this column and by date decreasing values.
Remove duplicates based only in the helper column.
Remove the helper column
Sort as desired
The trick is the sort. Sorting the helper column groups the repeat names per workshop and including the date by decreasing values ensures the most recent is at the top. So when you remove duplicates, the first occurrence will be the most recent and will be retained but subsequent entries well be removed.
I'd advise you to use the "Subtotals" Excel feature, choosing the Max function.
You might encouter problems as you need to give a single column in the first entry of the dialog, but this can be solved, creating an extra column, appending first name and last name, and basing your that (hidden) column (sorry for the Dutch, I don't have an English Excel):
The corresponding entries for the other columns can be found using basic search formulas (Match, VLookup, ...).
I would recommend using PIVOT as the simplest and fastest way:
Related
i'm trying to recreate a parser, inside different applications (just to find out a good and light way to do it) that, with a list of given values try to classify a row. Here it is an example:
Table1: contains items that have to be classified:
Code
Description
1
this is a common row that belong to Jake
2
this is a special row that belong to Thomas
Table 2: contains Keywords that have to be searched inside Table1 [Description]
Keywords
Category
common, Jake
Common Jake Row
special, belong, row, Thomas
Special Thomas Row
The result that i want to obtain is:
Code
Description
Category
1
this is a common row that belong to Jake
Common Jake Row
2
this is a special row that belong to Thomas
Special Thoams Row
Is there a way to have this in VBA or Excel or PowerBI?
Thanks in advance
Just do a fuzzy join in Power Query and tweak the threshold.
I have a homework assignment where I have to merge data of two excel sheets by performing some cleansing operations using formulas.
Sheet 1:
OrderID | Full Name | Customer Status
1001 Waqar Hussain Silver
2002 Ali Moin Gold
Sheet 2:
OrderID | First Name | Last Name | Customer Status
A1003 Junaid Ali 2
A2004 Kamran Hussain 1
Sheet 3:(Combined Sheet) - Expected
OrderID | Full Name | Customer Status
1001 Waqar Hussain Silver
2002 Ali Moin Gold
1003 Junaid Ali Silver
2004 Kamran Hussain Gold
There are probably a lot of ways to do this. First make sure the data is cleaned. If you are already 100% positive the data is clean you can skip this step. If you aren't sure it's better to be safe than sorry. For each column create a new column using the CLEAN and TRIM functions to remove any non-printable characters and any extra spaces. Something similar to =TRIM(CLEAN(A2)). Then drag the formula for each cell.
After this in order to merge the data together we need something to join on. The full name seems to make the most sense. On sheet two we'll write a new function to join the first name and last name together. The =CONCAT formula should work.
=CONCAT(First Name, " " ,Last Name). Make sure to note the extra space added by the quote. That way it matches the Full Name from Sheet 1. Looks like we'll also need to strip out the letter from Order ID in sheet 2. I'm going to assume that all Order IDs are 5 characters long. If this isn't true then you'll need a different solution. You can use =RIGHT(A2,4). This will grab the right 4 characters from the text string.
At this point let's create a distinct list. Copy the Full Names from Sheet1 and Paste them on to sheet 3. Copy the Full Names we created on Sheet2 and Paste VALUES onto sheet 3 below the full names from sheet 1. Then select all the rows in the column and go to the Data tab. Click "Remove Duplicates". This will now generate a distinct list of values.
We can now merge the data together using an INDEX MATCH. There are lots of great tutorials on how to use INDEX match in combination. It's a little long to explain on this thread, but this is a great thread explaining how it works. It's worth taking 10 minutes to fully understand it because it is a formula you will use thousands of times throughout your life.
https://www.deskbright.com/excel/using-index-match/
Let me know if I can clarify anything.
Best,
Brett
Currently I have a database that has 2 variables:
Fund with an ID attached to it and
Investor with an ID also attached to it.
The example attached, has 4 funds and 4 investors.
An investor can invest in 1 to 4 funds.
I have a VBA function that transposes the data into an "X & Y axis" format.
If there is a name "Ben & Jerry Fund" and "Ben" is present, it should show a quarter entry for that investor name but if the investor does not invest in the fund, it should just be blank.
Question: Is this possible?
Using the =IF(AND( function would not be possible here since there's so many funds and investors in the database.
Figure 1 shows the data reference (before transposing).
Figure 2 is the desired result.
If the purpose is to have a dynamic report. I mean if you want to append more years and avoid operative process. Follow this steeps:
Use "Format as table" for your data. This will allow you to append more data later and it will refresh the functions by itself.
Create a field to extract just the quarter number in the field [Quarter] with =MID([Quarter],1,1)
Create a field to extract the year =RIGHT([Quarter],4) this will allow you to use this field as a filter for future years
Create a pivot table using the new table then organize the data:
*Filter([Year])
*Rows([Fund Name], [Fund Id])
*Columns([Inversor], [Inversor ID])
*Values ([Quarter])
You will see the numbers for the quarter. If you want to see the letter "Q" you can change the format with right click, and select "Number Format...". There in "Custom" change to Q0
Here is a Tutorial about format as table and pivot tables that I made a few months ago. I am sorry it is in Spanish but I am using the Excel English version.
=IFERROR(INDEX($E$3:$E$12,SMALL(IF($C$3:$C$12=L$5,IF($A$3:$A$12=$K7,ROW($A$3:$A$12)-ROW($A$2))),1)),"")
Building an array of row numbers for INDEX and grabbing the first match (smallest row) based on the 2 if statements...
A pivot table can achieve what you want?
Part 1:
Cross Reference Column A Sheet 1 to find a matching value on Column A Sheet 2, and then fill in corresponding Column B, C, D Values from Sheet 2 for Sheet 1.
I have 2 sheets:
Sheet 1: Company & Representative
Sheet 2: Company & Client first name, Client Last Name, Client Email
I want to match to put in new columns on Sheet 1 that have the client first name, last name, and email based on the company matching ( they do not match by cell #).
Does anyone have any advice on how to do this? I've got about 2000 and know there must be a better way than manual.
Part 2:
Is it possible to use a similar formula to populate paragraph text in another column if the company name contains certain text or letters? Say the company titles are various and long but each contains adjectives that can help distinguish their industry or years of experience, then is it possible to make another column including 10+ possible conditions to fill out different paragraphs depending on the conditions met?
So for example have company names in column A drive company industry supply list (that will be in paragraph form) in column J. Here is an example:
Column:
ABC level 1
ABC level 2
ABC Levels Elementary
ABC Levels Advanced
BCD Level 4
BCD Level All
BCD Level Intermediate
(continued until infinity..)
XYZ Company Level 12
If Level 1-6 or Elementary: Input >
Eucalyptus is one of three similar genera that are commonly referred to as "eucalypts",
If level Intermediate: Input>
Tree sizes follow the convention of:
If Level Advanced: Input >
A mature eucalyptus may take the form of a low shrub or a very large tree. The species can be divided into three main habits and four size categories.
If level all: Input >
Eucalyptus is one of three similar genera that are commonly referred to as "eucalypts"
+
Tree sizes follow the convention of:
+
A mature eucalyptus may take the form of a low shrub or a very large tree. The species can be divided into three main habits and four size categories.
eucalyptus copy used for example only and to educate us all on the eucalyptus plant of course. ** changed the copy to shorter so we can more easily read the example**
enter image description here
Thanks so much!
Kalina
Say if I have a Sheet2 with data like the picture showing below:
My Sheet1 should look like this:
There are at least two ways to accomplish your goal:
VLOOKUP (show in column C, Matching 1):
=VLOOKUP(A2,Sheet2!$A$2:$D$8,2,0)&", "&VLOOKUP(A2,Sheet2!$A$2:$D$8,3,0)&", "&VLOOKUP(A2,Sheet2!$A$2:$D$8,4,0)
The VLOOKUP just repeated three times to concatenate the first name, last name and the email.
INDEX/MATCH (show in column D, Matching 2):
=INDEX(Sheet2!$A$1:$D$8,MATCH(A2,Sheet2!$A$1:$A$8,0),2)&", "&INDEX(Sheet2!$A$1:$D$8,MATCH(A2,Sheet2!$A$1:$A$8,0),3)&", "&INDEX(Sheet2!$A$1:$D$8,MATCH(A2,Sheet2!$A$1:$A$8,0),4)
Similar to VLOOKUP to repeat three times.
Hope this helps and let me know if you have any question.
Here is how you can do for your part 2:
For example you have setup a table to show different levels and descriptions (Column D and E). And you want to find the description under column B from the given company info on column A. Here is the formula you want to enter in cell B2 and copy/drag down.
=IFERROR(VLOOKUP(RIGHT(A2,LEN(A2)-FIND("Level",A2)+1),$D$2:$E$11,2,0),"Please verify company name")
What this does is first, use RIGHT(A2,LEN(A2)-FIND("Level",A2)+1) to find which level keyword inside the company name. Then use VLOOKUP to look the matching level and grab the description from column E. I also added an IFERROR just in case someone entered an incorrect name. You can change that message output to anything you like. Hope this will solve your problem and let me know if you have any question.
I would suggest putting data info on each tab into a tables, and then using an Index-Match or a vlookup to pull the data from the other table that matches. It's hard to give an exact answer without an image/example.
I am working on Excel 2007 and I need help with creating a pivot table.
My excel sheet looks some what like this
Name Date Team Location
John 2011-05-01 Project NY
John 2010-10-12 Information NY
John 2010-02-04 Development CA
Sam 2011-05-01 Development CA
Sam 2010-01-01 Project NY
Sam 2008-01-01 Programmer NY
Brad 2011-04-03 Project NY
Brad 2009-01-01 Info NY
Brad 2007-01-01 Designer CA
Now, if I create a pivot table based on the data above, and put a filter on the "Date" to see who worked at where aka "Location" under what "Team", let's say between "2010-01-01 to 2011-12-31"
Then it will count "John" three times, "Sam" twice and "Brad" once. And total of 6 employeses working during "2010-01-01 to 2011-12-31"
Now I want to remove these duplicates so that if "John" is counted once, he won't be counted anymore, even if he switched to different "Team" or "Location" so I can count for the total number of employees during "2010-01-01 to 2011-12-31" without any duplicates.
I understand that if I want to edit the pivot table and create unique value to remove these duplicates, I need to add another column. But I need help creating this column.
Could anyone help me out here?
Thanks a lot guys!
Anyway, tell me if this would work for you.
1) Sort your spreadsheet by 'Name' first and by 'Date' second.
2) Add an extra column called 'Old Position'.
3) Go down the sorted list and for every name with duplicate rows that you encounter, leave the first occurance alone, but add an 'X' to the column 'Old Position' for all of the older duplicates.
Now you can filter by keeping rows that have their 'Old Position' column not equal to 'X'. This should give you just the most recent positions for all employees.
As long as there are not two distinct employees with the exact same name, I think this should work (otherwise try to use an employee id or somethings unique to each individual instead of their name).
Put "Date" in report filter, "Name" in row labels, set filter for "Location" as "NY" then "Location" can in placed in either report filter or row labels depending on how you want to see data.