excel function to find 1 student in more than 1 course - excel

I am working on a file that has students and the courses in which they have enrolled. I have to find if they have enrolled in more than 1 course. which formula will be suitable in excel?

I'm using following formula (using the helper column "Both together"):
=COUNTIF(C$2:C6, C6)
Where my data look as follows:
The column "Both together" consists of the following formula:
=A2 & "|" & B2

Related

Combine date range in column A row 3 though 9 and repeat every 7 rows

I have an excel sheet where I need to take an average cost of 7 days. I have two columns, one with a date and the other with a charge. See the attached screenshot for reference and output. The formula I'm using for charges works as expected in column d. I need to find a way to add the date range in column c. Please advise
Date: Need help here - Column c should repeat, and the next cell should have 2022-08-02 and 2022-14-02. The current formula starts on 2022-02-02 if I drag the cell.
Try below formula to google-sheet.
=INDEX(TEXT(A2+SEQUENCE(10,1,0,7),"yyyy-dd-mm") & " " & TEXT(A2+SEQUENCE(10,1,6,7),"yyyy-dd-mm"))
For Excel-365 no need INDEX().
=TEXT(A2+SEQUENCE(10,1,0,7),"yyyy-dd-mm") & " " & TEXT(A2+SEQUENCE(10,1,6,7),"yyyy-dd-mm")

Find matches of 2 items in 2 different columns

Hello good afternoon community. I have an Excel question
I have this table
enter image description here
I can't find a way to determine which is the combination that is repeated the most but in both directions.
I mean, with the function count.si.set I can count how many Italy vs Portugal there were (12) but it doesn't give me how many Italy vs Portugal + Portugal vs Italy there were (14)
What is the step that I am missing?
You can use the greater than operator to check which word comes first alphabetically. Eg, IF(A1>A2,1,0) will return a 1 if the word in Cell A2 is alphabetically Earlier than the word in Cell A1.
Use this in the "Enfrentamientos" column with the following formula:
IF(A1 < B1, A1 & " " & " " B1, B1 & " " & A1)
This cells output will be the words in A1 and B1 concatenated in alphabetical order, so your Argentina & Germany pairs will come out the same as your Germany & Argentina Pairs.
Copy that formula down to the lower rows so it applies to each pair
Hope this helped!

Excel: Find the Position/Location of Each Occurrence of a Specific Word in a String in a Column

Using an MS Excel formula, I would like to find the Position(s)/Location of specific words found within a String of text located in a Range/Column of cells.
I'm using a formula that only identifies and finds the position(s) of a keyword by a single cell versus a column. I'm not able to repeat this action by looking throughout the column cells, using my numeric helper column (Cell D2:D12 "Occurrence") which provides the occurrence of the next position to be found.
Helper columns are welcomed if necessary to achieve the desired results.
The cells highlighted in "Red" is what I'm looking for as the final output results.
See below for formulas used for Column C and D. Text string is located in Column A2:A12.
COLUMN A
DATA TEXT
Dolly would not count her eggs but Count her apples
Tony drove a pickup truck to work
Over many nights he could not sleep
Only this and nothing more
She went by to pickup her son
To many times he would count over
They went shopping for Christmas
You can count him to pickup someone
They count so much they would sleep in his pickup
Nobody would play with Timmy
Trying to find the position location of each word
COLUMN B
Keyword List
Toe
Shoe
Count
Pumpkin
Pickup
Randy
Sally
Sleep
Jonathan
C2: =SUMPRODUCT((LEN($A$2:$A$12)-LEN(SUBSTITUTE((UPPER($A$2:$A$12)),UPPER(B2),"")))/LEN(B2))
D2&E2: =FILTER(B2:C10,C2:C10>0)
F2: =IF(E2="","",REPT(D2&"^",E2))
G2: =TEXTJOIN("",TRUE,F2:F4)
H2: =TRIM(MID(SUBSTITUTE($G$2,"^",REPT(" ",LEN($G$2))),(COUNTIF($H$1:H1,"<>&""")-1)*LEN($G$2)+1,LEN($G$2)))
I2: =IF(H2="","",IF(COUNTIF($H$2:H2,H2)>1,SUM(I1+1),1))
Try the below picture set up and formulas solution as in.
1] C2 "Total occurrence", formula copied down :
=SUMPRODUCT(LEN($A$2:$A$12)-LEN(SUBSTITUTE(LOWER($A$2:$A$12),LOWER(B2),"")))/LEN(B2)
2] D2 "Count", formula copied across to F2"Sleep" and all copied down :
=SUMPRODUCT(LEN($A2)-LEN(SUBSTITUTE(LOWER($A2),LOWER(D$1),"")))/LEN(D$1)
3] G2 "Keywords" , formula copied down:
=LOOKUP(ROW(A1),SUMIF(OFFSET(C$1,,,ROW($1:$12),),"<>")+1,B$2:B$4)&""
4] H2 "Occurrence", formula copied down:
=IF(G2="","",COUNTIF(G$2:G2,G2))
5] I2 "Content Keyword Data Text", formula copied down:
=IF(G2="","",LOOKUP(H2,SUMIF(OFFSET(INDEX($1:$1,MATCH(G2,$1:$1,0)),,,ROW($1:$12),),"<>")+1,$A$2:$A$12))
6] J2 "Position", formula copied down:
=IF(G2="","",FIND("~",SUBSTITUTE(LOWER(I2),LOWER(G2),"~",COUNTIFS(G$2:G2,G2,I$2:I2,I2))))

Formula to Return Text in the Row of Largest Number

Column A Has Text & Columns B, C & D contain numbers.
For Ex.)
A... …B C D
John 4 6 2
Dave 4 6 4
Mike 4 5 1
Bill 2 5 9
I would like a cell to return the name in column A that has the Largest Number in Column B. And if there are similar numbers, go to the next column and determine which is highest, and if that is tied go to the next column and so on.
Any help would be appreciated.
We can de-conflict ties.In E1 enter:
=B1 + C1/(10*MAX(C:C))+D1/(100*MAX(D:D))
and copy down. Then in another cell enter:
=INDEX(A:A,MATCH(MAX(E:E),E:E,0))
EDIT#1
This is only good for 3 columns of numbers, but it is very easy to add additional de-confliction terms if necessary:
=B1 + C1/(10*MAX(C:C))+D1/(100*MAX(D:D))+E1/(1000*MAX(E:E))
For an expandable number of rows/columns, use a helper row with the same number of columns as number columns in your data. The formulas below reference the following image (the data are in A1:G7):
B9-->=MAX(B1:B7)
C9 (fill over the remaining columns to G9)-->
=MAX(IF(MMULT(--($B1:B7=$B9:B9),--(ROW(INDIRECT("1:"&COLUMNS($B9:B9)))>0))=COLUMNS($B9:B9),C1:C7))
The following formula will give the answer (shown in A9 above):
=INDEX(A1:A7,MATCH(TRUE,(MMULT(--($B1:G7=$B9:G9),--(ROW(INDIRECT("1:"&COLUMNS($B9:G9)))>0))=COLUMNS($B9:G9)),0))
UPDATE WITH ALTERNATIVE METHOD
Using a helper column instead, again referencing the image below (the data are in A1:G7):
I1 (fill down to I7)-->
=SUM(--(MMULT(SIGN(B1:G1-$B$1:$G$7)*2^(COLUMN(G1)-COLUMN(A1:F1)),--(ROW(INDIRECT("1:"&COLUMNS(B1:G1)))>0))>0))
The following formula will give the answer (shown in J1 above):
=INDEX(A1:A7,MATCH(MAX(I1:I7),I1:I7,))
As a bonus, notice that the helper column corresponds to the order that you would get from sorting the data by each column left-to-right. In other words, you could use the helper column to perform a formula-based multi-column sort on strictly numeric data. For the last image, entering the following array formula into a range with the same dimensions as A1:G7 gives a descending sort on columns B through G:
=IF(A1:A7=A1:A7,INDEX(A1:G7,MATCH(ROW(A7)-ROW(A1:A7),I1:I7,0),))

excel counting + matching 3 columns

I have a log where I have two columns (H&G) where I have sales people's names inputted for each row. Column I lists the row as belonging to one of three categories ("name1" "name2" or "name3").
On the next sheet in the book I have tabulations for counting how many times each person's name appears, but what I'd like to do is cross reference that with how many they appear next to each of the categories.
ie I currently can tell that Steve has 6 deals. But what I'd like to know is that Steve has 4 of name1 and 1 each of name2
edit:
So I think I've not been clear on what I'm searching for: I am trying to sum the number of times a salesperson's name appears in columns F or G that also have a string in column H.
ie: Steve's name appears 13 times, but only 8 of those are on rows that have Phone
Assuming your data is as in the image below, try following formula
=COUNTIFS($F2:$F9,J2,$H2:$H9,K2)+COUNTIFS($G2:$G9,J2,$H2:$H9,K2)
Drag/Copy down formula as required and change range as per your data.
In above formula I am assuming you want to consider Column F and column G separately for category. In case you want both Column H & G to have same name for category then use
=COUNTIFS($F2:$F9,J2,$G2:$G9,J2,$H2:$H9,K2)
This will give result 1 as only Row 5 has Steve in both Column F & G matching category Phone.
EDIT : As per #ForwardEd's comment
If you want to count row having same Name in both Column F & G only once (as in Row 5 in image), then subtract above two formulas as
=COUNTIFS($F2:$F9,J2,$H2:$H9,K2)+COUNTIFS($G2:$G9,J2,$H2:$H9,K2)-COUNTIFS($F2:$F9,J2,$G2:$G9,J2,$H2:$H9,K2)
or use
=SUMPRODUCT((($F$2:$F$9=J2)+($G$2:$G$9=J2)>0)*($H$2:$H$9=K2))
This will give result 3 for Name=Steve and Category=Phone considering Rows 2,5,8 (note : Row 5 has Steve in both Column F & G but will be counted once).
Use COUNTIFS:
=COUNTIFS(A1:A6,"steve",B1:B6,"name1")
For referencing from multiple sheets:
=COUNTIFS(A1:A6, "steve", Sheet2!A1:A6, "name1")
you can make n columns for each column you'd like to know and or you can make a single big column with multiple formulas.
You can use the & symbol to string together a long formula in a single cell.
Like:
="Month 1: "& countif(G1:G10,"Steve") & " " & "Month 2: "& countif(H1:H10,"Steve")
All that will output: Month 1: 4 Month 2: 2
you can string a lot of functions with the & symbol, so you can change the placeholder and stuff.
Also you can change the inquote string "Steve", for a reference so you'll just have to write this big formula once.

Resources