Excel formula to count discrete instances of referenced cells - excel

I have a column of strings, representing names, where there can be more than one name per cell and each is separated by a semicolon. There is a column next to it that has a single character which represents a category. To illustrate:
My desired outcome is shown in the second box. What I need is a formula that, for each name in column B, counts up how many instances of the categories in column C were assigned to it.
I'm having difficulty reconciling the fact that there may be multiple names in each cell in column B. Can anyone think of an easy approach here?

Just use COUNTIFS and wildcards:
=COUNTIFS($B$2:$B$5,"*"&$G3&"*",$C$2:$C$5,H$2)

Related

Excel: Sort column by specific names, than add the sum of the sorted items to separated cell

I have a column where I am going to add 3 specific strings ("zero","one","two").
These items will be sorted by default. I want a separated cell for the "zero" to search how many "zero" are there in the column and calculate the sum of them.
The problem is that every time when I use this document, the amount of "zero"-es will be different.
As far I understood your question is that you have a column with Multi names (Zero, One and Two) with a corresponding value cell and you want add the values of all the Zeros. Well as by this, the Sumif() function will help you good. See the picture at Following. see in the formula bar
and use Countif() to count the Zeros in the Column.

Spreadsheet summing based on substring match

I am struggling with one part of this exercise. I'm able to sum based on one column unique values (i.e. column G). I'm also to extract unique names from columns with multiple names in same cell (column I). What I am not able to do is get work assigned for the person from multiple rows. For simplicity, the work is just divided equally between number of people in that row.
Desired outcome is in column L. Sample sheet to work with is here
https://docs.google.com/spreadsheets/d/1xwv8IV-XNMArSFZEdT8mR-ZbOFHRFFZMfAm7dwm3bbE/edit#gid=741595390
Try it as (in J3),
=SUMPRODUCT((D$3:D$8)/(LEN(C$3:C$8)-LEN(SUBSTITUTE(C$3:C$8, " ", ""))+1), --ISNUMBER(SEARCH(I3, C$3:C$8)))

Excel: Need to count occurrences that values in column are greater than another column AND value in a third column is specified

The dummy data below is similar to the data I'm working with. I want to check how many instances that the value is greater than the goal, only in one region at a time.
To clarify, I have already figured out how to count the number of occurrences in which values in one column are greater than corresponding values in another row as follows:
=SUMPRODUCT(--(A:A>B:B))
or (as an array formula):
=SUM(IF(A:A>B:B,1,0))
I have another column specifying different regions in the country. I want to count these same occurrences for individual regions. For example, when the region is "Southeast". I have tried adding an & statement within these previous formulas, as well as multiple sumifs, countifs, and various variations of all of the above. I am continuously either getting a 0 or an error as my answer.
Thanks in advance!
You can use:
=SUMPRODUCT(--(C:C>B:B)*(A:A="Southeast"))
C is the column of Values
B is the column of Goals
A is the column of Region

Match two cells and copy from a third cell

I have a list of two names. One, the employee list, the other, a list of transfers. I want to match the names and then in an adjacent column post the new city.
I am using the following and I realize that the $X$1 will only post the first transfer city to all of the applicable names.
=IF(ISERROR(MATCH(D1,$Q$1:$Q$159,0)),"",$X$1)
What can use to replace the $X$1 ?
Looks like it's =LOOKUP() time:
=IFERROR(LOOKUP($D1,$Q:$Q,$X:$X),"")
Assuming list of employees is in column Q and list of transfer cities is in column X.
Notes:
=IFERROR() allows to simplify =IF() and =ISERROR() combo.
You can pass the whole columns and rows to functions instead of fixed ranges. This is useful because you don't have to rewrite your formulae each time more data are added. $Q:$Q means whole column Q, 1:1 means whole row 1 etc.
It's a good practice to fix the column of parameters, even if you don't plan to copy your formula to another column: $D1.

Excel Instance Parsing

I have a list of data "instances" within one column within an excel sheet.
Each instance can have numerous copies. Here is an example:
abcsingleinstanceblah0001
cdemultipleinstanceexample0001
cdemultipleinstanceexample0002
cdemultipleinstanceexample0003
cdemultipleinstanceexample0004
....
Unfortunately the numbering scheme was not preserved across all of this data. So in some cases copies will have randomized numbers. However, the root instance name is always the same.
QUESTION: What would be a good strategy for creating a function that will parse a list of these instances and, in a new column, list all duplicates past the second copy? In relation to the example above, the new column would list:
cdemultipleinstanceexample0003
cdemultipleinstanceexample0004
I need to have the two duplicates with the lowest integer values preserved out of each set of duplicates, which is why in the example above 3 and 4 would have to go. So in the case of randomized numbers, the two instances with the lowest integer values.
What I have thought of
I was thinking to first organize the column by alphabetical order, which should automatically put duplicates in ascending order. I could then basically strip the number value from all instances, and find where there are more than 2 exact duplicates from the core instance name, which would give me the instances with more than 2 duplicates so that I could perform a function on the original data set... but I don't know if there is a better way of doing this or where to go from here.
I'm looking for formula-based solutions.
Assuming your sorted list is in Column A and that you have a row of headers you could use the following formulas in the neighboring columns.
In B:
=LEFT(A2,LEN(A2)-4)
In C (although not really necessary):
=RIGHT(A2,4)
In D starting with row 3:
=IF(AND(B3=B2,COUNTIF(B1:B3,B3)>2),"Del","Keep")
This formula doesn't work in row 2, but you can hard code the first result.
Then filter the list on Column D for "Del" and delete all the rows.
How's that?
Sort your list in column A. You'll want column headings for later so put those in row 1 (or leave it blank. In B2, type =left(A2,len(A2)-4) and drag the formula down to strip the integers. In C3 type =vlookup(B3,$B$2:$B2,1,0). Populate the formula in C3 right one cell and then down the length of the data. Now in D3 you'll have a list that has errors for any entry that only 2 or fewer instances and will have the name for any that have 2 or more. Sorting this list with a filter on row D for #NA will allow you to delete all the rows with less than two entries.
Remove your filter. Then resort the list in column A in reverse order so the high numbers are first. Replace the contents of C2 and D2 with #N/A. Refilter the list on column D for everything but #N/A and delete all the entries that have an instance listed.

Resources