Searching for 2 different values in the same cell in a different tab

andrebooyzen

New Member
Joined
May 30, 2023
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hi All

I need some help please. I am using the following formula to search and count the occurrences of 2 different values occurring together in the same cell in a separate tab. I am searching a range of cells in the tab and the matches may occur more than once in the range. In this case I am just testing the formula by using AAA and JJJ to search for. Excel keeps saying there is an error in the formula. Any help would be appreciated. Thanks :)

=COUNT(IF(OR(ISNUMBER(SEARCH("AAA",'15Apr24'!$J$3:$N$23)),ISNUMBER(SEARCH("JJJ",'15Apr24'!$J$3:$N$23)),1,"")))
 
If you look in the XLSB sheet I have just pasted, you will see an example. I just used the AAA and JJJ as a test.
The first search always appears first in the cell and the 2nd one always second (i.e. AAA is always first and JJJ second). They will never be swapped around.
In the sheet attached cells C21 and D21 contain the same 2 people. Also cells E21 and F21.
What I am trying to do is count the number of times the first name is matched with the second name in a matrix.

BTC Running Sheet.xlsx.xlsb
ABCDEF
1Change dates when creating new weekAshmore
2--->>>Monday 15Apr24Tuesday 16Apr24Wednesday 17Apr24Thursday 18Apr24Friday 19Apr24
308:0008:00-09:40 Andre B Ebony B
408:3008:30-10:10 Andre B Mika Y110
509:0009:00-10:40 Colin B Mika Y11009:00-10:40 Adam L Jordyn L09:00-11:20 Martin A Mika Y
609:30110100100
710:0010:00-11:40 Mal A Heldy S
810:3010010:50-12:20 Adam L Joshua L
911:0011:00-12:40 Colin B Heldy S11:00-12:40 Paul H Jordyn L10011:00-12:40 Ashley C Alexander B
1011:30100100100
1112:0012:00-13:40 Garry Joshua L
1212:30100
1313:0013:00-14:20 Alex V Pamela A13:00-14:40 Rod M Isabella L13:00-14:40 Rod M Pamela A
1413:30100100100
1514:0014:00-15:40 Paul H Isabella L
1614:30100
1715:0015:00-16:40 Mal A Victoria D15:00-16:40 Pam M Ebony B15:00-16:40 Garry Ebony B15:00-16:40 Steve M Saleha I
1815:30100100100100
1916:00
2016:30
2117:0017:00-18:40 Jan N Farishta J17:00-18:40 Jan N Farishta J17:00-18:40 Callen P Mia A17:00-18:40 Callen P Mia A
2217:30110110110111
2318:00
15Apr24
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
The first search always appears first in the cell and the 2nd one always second (i.e. AAA is always first and JJJ second). They will never be swapped around.
In that case try this. Remove all the formulas from B11:Q130 and place the formula shown below in B111. No need to copy it anywhere.


24 04 10_1.xlsm
ABCDEFGHIJKLMNOPQ
1Change dates when creating new weekAshmore
2--->>>Monday 15Apr24Tuesday 16Apr24Wednesday 17Apr24Thursday 18Apr24Friday 19Apr24
308:0008:00-09:40 Andre B Ebony B
408:3008:30-10:10 Andre B Mika Y110
509:0009:00-10:40 Colin B Mika Y11009:00-10:40 Adam L Jordyn L09:00-11:20 Martin A Mika Y
609:30110100100
710:0010:00-11:40 Mal A Heldy S
810:3010010:50-12:20 Adam L Joshua L
911:0011:00-12:40 Colin B Heldy S11:00-12:40 Paul H Jordyn L10011:00-12:40 Ashley C Alexander B
1011:30100100100
1112:0012:00-13:40 Garry Joshua L
1212:30100
1313:0013:00-14:20 Alex V Pamela A13:00-14:40 Rod M Isabella L13:00-14:40 Rod M Pamela A
1413:30100100100
1514:0014:00-15:40 Paul H Isabella L
1614:30100
1715:0015:00-16:40 Mal A Victoria D15:00-16:40 Pam M Ebony B15:00-16:40 Garry Ebony B15:00-16:40 Steve M Saleha I
1815:30100100100100
1916:00
2016:30
2117:0017:00-18:40 Jan N Farishta J17:00-18:40 Jan N Farishta J17:00-18:40 Callen P Mia A17:00-18:40 Callen P Mia A
2217:30110110110111
2318:00
24
25
108
109
110M/PAlexander BBrenden HEbony BFarishta JHeldy SIsabella LJordyn LJoshua LMelessa SMia AMika YPamela ASaleha IVictoria DZoe MNO P
111Adam L0000001100000000
112Alex V0000000000010000
113Andre B0010000000100000
114Ashley C1000000000000000
115Bruce S0000000000000000
116Callen P0000000002000000
117Chris R0000000000000000
118Colin B0000100000100000
119Garry0010000100000000
120Helen B0000000000000000
121Jan N0002000000000000
122Mal A0000100000000100
123Martin A0000000000100000
124Noel K0000000000000000
125Pam M0010000000000000
126Paul H0000011000000000
127Rod M0000010000010000
128Rod S0000000000000000
129Steve M0000000000001000
130NO M0000000000000000
15Apr24
Cell Formulas
RangeFormula
B111:Q130B111=COUNTIF(B3:F23,"*" &A111:A130&"*"&B110:Q110&"*")
Dynamic array formulas.
 
Upvote 1
Solution

Forum statistics

Threads
1,215,203
Messages
6,123,627
Members
449,109
Latest member
Sebas8956

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top