Pivot count names by groups - excel

I have a PivotTable with a variety of personal names, you can then expand each person to find out if he is A, B, C , A and B, A and C , or B and C.
I want the number of A and B's specific, not just how many people have two letters.
So how I count the number of A and B , A and C's , and B and C's ?

Create a separate pivot table and put your field which contains {A,B,C,D} into the Row Labels and Values fields

Taking your comment into consideration, I think what you want is the count of people numbers by category (ie assumes each person fits into only one type, even though the type may be 'compound'), for example:
where the left-hand columns represent your existing PivotTable. You might be able to achieve this result with a different view from your existing PT.

Related

find the serial number with criteria

I have an Excel database, and they are asking me to find the 8-digit pserial value for the oldest current smoker in the survey. The person is a smoker if cigst is 4.
The pserial numbers are in column 3 and smokers are in column N.Age is column
this is the database, but there is more data inside the database:
I think the functions to use are INDEX, MAX and IF, but not sure on what order to use.
The following should work, assuming the input data are in the range of 11-100 rows. You can adapt it to your actual range. Considering also no excel version constraint based on tags listed in the question .
=LET(f, FILTER(HSTACK(C11:C100, H11:H100), N11:N100=4), fa, INDEX(f,,1),
fb, INDEX(f,,2), TEXTJOIN(",",,FILTER(fa, fb=MAX(fb))))
You filter first a subset of pserial and age columns based on cigst column values equal to 4, then just find the maximum. Preventing more than one pserial value correspond to the maximum age, we use TEXTJOIN to concatenate the result. If it is not expected for your real case, then you can remove this last step.
If there are several people with the same age, it is easiest to use the filter function:
=FILTER($C$11:$C$39;($H$11:$H$39=MAXIFS($H$11:$H$39;$N$11:$N$39;4))*($N$11:$N$39=4))
Maybe you have replace semicolon with comma, depending of your Excel version.

Cross Reference Column A Sheet 1 w/ Column A Sheet 2 to give column c,d,e

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.

Matching Requirements in Multiple Records of a Table in Excel

I've searched for this issue for quite some time and I now had to create an account to ask. It feels like such a generic question and I'm not sure how to tag it.
I need to create a table in excel that has a list of customers in column A and then 10 columns in B through K with 10 uniform customer labeling requirements (i.e. if a customer needs the requirement in column C, they get a mark in column C on their row). I want an easy way to see what customers have the same requirements. My first thought is this:
Customer Requirement B Requirement C Requirement D Concatenated
John's Tools B C BC
Kate's Cats B D BD
Tim's Toys C C
Jack's Gym B C D BCD
Carl's Cars B C BC
I'm thinking if I just sort on the concatenated column, it will give me what I'm looking for, but maybe the community here has a different thought. Here's what I think it would look like sorted:
Customer Requirement B Requirement C Requirement D Concatenated
Carl's Cars B C BC
John's Tools B C BC
Jack's Gym B C D BCD
Kate's Cats B D BD
Tim's Toys C C
If anyone thinks there is a better way to utilize this table (or if it's the wrong format to begin with) to see the matching requirements, I would love to see it.
BONUS CHALLENGE: I'm also looking for a way to see if customers are "mostly similar," as my boss puts it, but I'm just leaving this out there. I think the sorting method works okay, but it doesn't help if two customers are extremely similar (6 out of 7 requirements) but have a different beginning requirement (i.e. B and C would be sorted far away from each other because of how many customers are in the table).
The idea of concatenating the fields is not a bad option and will work. However, have you considered using TABLES and even PIVOT tables.
If you enable tables (select your data, then click Home/Format as Table) then you could easily apply a filter on all clients that have a "B" in the requirement "B" column, and in "C" etc. The filter in the TABLE works on the "AND" condition, so if you select all the filters, then the end result will be only the people that actually need to complete all the requirements. Selecting a "blank" in one of the filters will only show the people that don't need that requirement.
You could also achieve something very similiar with a pivot table, but that will be slightly more processing intensive.
Regarding your bonus question, you could assign a weight to each requirement and sum the weights up. So, assume the definition of "similiar" is AB is the same as AC, but ABC is different, then you could assign a value of say 100 to A, 50 to B, 50 to C, then by summing up the requirements, you will get 150 for both AB and AC, and 200 for ABC. Couple of ways to achieve that, but you will require input from your boss to determine what is defined as "like each other" and it will most likely require some tweaking.

Outputting text values

I am unsure Excel would be able to do this automatically. I hope it can but maybe not.
I am trying to work with another member of staff in a different building. I have created a table trying to identify where the flow of some of the work is coming from. I am looking to try and count the amount of instances of text within a column. The problem is that the text can be pretty dynamic. As an example:
Consultant
a
a
b
a
b
a
b
z
c
c
c
Is there a way I can get excel to count the instances of text within the column, then create a table with the totals of the counts in it with labels.
I looked at pivot tables and that didn't seem to want to play ball.
The simplest way to do this is using COUINTIF
=COUNTIF(A:A,"a")
Which will simply tell you how many times "a" appears in the Column A.
You could easily duplicate this for every letter of the alphabet. Then use a summary table to display the results.

using conditional named range in excel

Let me try this again, I've been searching the web and can't seem to find anything. What i'm trying to do is in excel have a bunc of named range list conditional based on a value of another cell. The problem I'm running into character limit when I setup the data validation and put all my IF statements in source textbox. If i just put two conditions it seems to work fine, but that won't work for me. Here is my example data, based on the B column value I want to display the valid sub-items for it. Like I mentioned I have 20 or so different possible values that could be in column B.
B C
1 ENG dropdown of all engineering sub-categories
2 PRO dropdown of all production sub-categories
3 PER ...
4 PAY
5 ENG dropdown of all engineering sub-categories
6 ENG dropdown of all engineering sub-categories
When i try to setup my data validation list on column C1, I put in the following...
=IF($E$5="CAR", CA,
IF($E$5="DCC", DCC,
IF($E$5="ENG", ENG,
IF$E$5="ENV", ENV,
IF$E$5="FBI", BI,
IF$E$5="FGL", GL,
IF$E$5="FAP", AP,
IF$E$5="FRE", AR,
IF$E$5="FTX", Tax,
IF$E$5="ORM", OAR,
IF$E$5="PAY", PAY,
IF$E$5="PIR", PER,
IF$E$5="PRO", PRO,
IF$E$5="PUR", PUR,
IF$E$5="RSK", RM,
IF$E$5="SLM", Sales,
IF$E$5="WFS", WAR)))))))))))))))))
I'm only able to type in maybe half of my IF condition. I tried VLOOKUP but that only allows for 1 value to be put in column C, and I want it to be a dropdown. Any help would be much apprecriated.
You can do this in a much shorter formula by combining VLOOKUP and INDIRECT:
Have you list of of potential names in column B and their corresponding range names somewhere in two columns, e.g. column X & Y:
Col X Col Y
CAR CA
DCC DCC
ENG ENG
ENV ENV
FBI BI
...
Then use the following formula as the source of the list in the Data Validation:
=INDIRECT(VLOOKUP($E$5,$X:$Y,2,0))
Actually, with this approach you can potential even save the effort of naming and maintaining the manual range names! Instead, just replace the name of the named range with the real address - which - with a bit of luck and smart formula engineering - you can derive automatically. This depends on your data structure, but most likely the functions ADDRESS, COUNTA, OFFSET, INDEX and MATCH will be helpful.
E.g. if your lists would be stored in another worksheet with the name of the list in the first row and the elements listed below each header, this example file will provide you the example formulas. One step further, it'll also use conditional highlighting to mark any entry that is invalid, e.g. because the type was changed after the selection:

Resources