Excel formula, find similar string between two columns - excel

I want find a formula who allows to check like this :
column 1 :
row 1 : "AAA AA ABB A"
...
column 2 :
row 1 : "LLL BBLL"
...
the formula return TRUE with rows 1 of the two columns because there is "BB"
I don't want search "BB" but find if two rows are "similare" like this example.
Thanks you =)
Is it possible via formula ? (no vb)

This is maybe possible with the following approach:
This is a German Excel. WAHR=TRUE and FALSCH=FALSE ;-)
Formulas in
C4:
{=NOT(AND(ISERROR(FIND(MID($A4,ROW($A$1:INDEX($A:$A,LEN($A4)-$C$2+1)),$C$2),$B4))))}
and in D4:
{=NOT(AND(ISERROR(SEARCH(MID($A4,ROW($A$1:INDEX($A:$A,LEN($A4)-$C$2+1)),$C$2),$B4))))}
These are array formulas. Input them in the cell without the curly brackets and the press [Ctrl]+[Shift]+[Enter] to complete.
The approach is to get an array of $C$2 length substings from string in column A and find/search them in the string in column B.

Related

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.

Excel MATCH to sum of two cell values

I have a table of data that include a name column and two numeric columns. Example:
A B C
Fred 4 2
Sam 3 6
George 1 7
I'm wanting to retrieve the name in column A for the largest sum of columns B and C. In the example above, I would want "Sam" because 3+6 is greater than any of the other sums.
I know I could create a hidden column (D) that's filed with
=SUM(B2,C2)
and do something like this:
=INDEX(A:A,MATCH(MAX(D:D),D:D,0))
but I'd rather avoid the hidden column, if possible. Is there a way to perform an index-match based on the sum of two cells?
Use the array formula:
=INDEX(A:A,MATCH(MAX((B:B)+(C:C)),(B:B)+(C:C),0))
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.
(Note the appearance of braces in the formula bar)

Use Excel to look for 2 string values over 2 columns and in one row and return the cell value if there is a match on either of the lookup strings

I would like to have some help with creating an MS Excel 2013 formula that would do the following.
It should look for two string values over 2 columns in one row and should return the cell value of the cell in which the string value was found.
Sorry if I am not explaining myself correctly. Here is an example of the dataset and my expected result
My Dataset have 2 columns A and B but I would like only 1 output in C if ocn OR ocm exist.
I would like to use this formula to normalise this data set.
A B C (Result for ocm or ocn)
(OCoLC)911180191 (OCoLC)ocn911180191 (OCoLC)ocn911180191
(OCoLC)ocn911180196 (OCoLC)911180196 (OCoLC)ocn911180196
(OCoLC)911495338 (OCoLC)ocm911495338 (OCoLC)ocm911495338
(OCoLC)ocm794701569 (OCoLC)794701569 (OCoLC)ocm794701569
Click to see a picture of what I am trying to do
In C2 Cell
=IF(SUM(COUNTIF(A2,{"*ocn*","*ocm*"})),A2,IF(SUM(COUNTIF(B2,{"*ocn*","*ocm*"})),B2,""))
Or
=IFERROR(LOOKUP(2,1/MATCH({"*ocn*","*ocm*"},A2:B2,0),A2:B2),"")
Or
=IFERROR(LOOKUP(2,1/SEARCH({"*ocn*","*ocm*"},A2:B2),A2:B2),"")
Or
=IF(SUMPRODUCT(--ISNUMBER(SEARCH({"*ocn*","*ocm*"},A2))),A2,IF(SUMPRODUCT(--ISNUMBER(SEARCH({"*ocn*","*ocm*"},B2))),B2,""))
Drag the C2 Cell formula down.

Formula to sum items in a column only if other column has specific value

I have an excel table with 2 columns. First column contains a string such as A,B,C and second column contains numbers. I want to obtain sum of numbers in each row if text of first column for that row is equal to given text.
For example:
A 2
C 3
B 4
A 1
C 3
formula(A) = 3
formula(B) = 4
formula(C) = 6
and so on.
One way to achieve this is via SubTotal option. Follow the example in this link Creating subtotals
Another way to do the same is using sumif function follow this link Sumif function
SUMIFS() is capable of doing this. As is SUMPRODUCT()
In european excel this would look like this. I don't know where your reference is so I am putting it in a cell named Reference.
SUMIFS($B:$B;$A:$A;"="Reference)
If you want a "running" count, then replace the arrays - from $B:$B to B$2:B2 and similar with $A:$A, and copy it down the rows.

Count with criteria for changing column in excel

I have a data looks like this:
a b c
1 3 4
2 3 3
4 1 2
2 4 2
In another worksheet, I want to do the following calculation:
whenever A1 returns a (header of data worksheet), count number of items that are smaller and equal to 2 in column "a". (result will be 2)
if A1 returns b, count number of items that are smaller and equal to 2 in column "b". (result will be 1).
A1 has already been preset with formula such that it will show a or b or c as conditions changed.
I need the formula to be lean... I actually have 6 headers, so if I keep on using if functions, I will probably have to set 6 if functions in one cell...that can be overwhelming. index match cannot provide a range to work on...Any suggestion? thanks
I don't know vba. If you could provide a workable vba code, i don't mind. but i don't know how to read it...>.< please provide user manual for that. lol, thank you~
If your data is found on Sheet1 and the a is found on column a, b is found on column b etc. enter this formula on then next sheet on b1 when a1 is the column value:
=COUNTIF(INDIRECT("Sheet1!"&a1&":"&a1),"<=2")
The Indirect is for adding text to your reference.
If your data sheet is Sheet1, you could try the array formula:-
=SUM((Sheet1!A1:C1=$A$1)*(Sheet1!A2:C5<=2))
Must be entered with CtrlShiftEnter
(actually there are 3 items less than or equal to 2 in column A)
Or you can use the SUMPRODUCT version if you prefer not to use an array formula:-
=SUMPRODUCT((Sheet1!A1:C1=$A$1)*(Sheet1!A2:C5<=2))
Or you can use this INDEX/MATCH method which is probably more efficient:-
=COUNTIF(INDEX(Sheet1!A2:C5,,MATCH(A1,Sheet1!A1:C1,0)),"<="&2)

Resources