Combine several conditions for count formula

Tupelo1984

New Member
Joined
Jan 26, 2021
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Dear, I am looking for two count formulas that can combine several conditions. The first formula I need help on is:

Formula 1
condition 1/ Returns count '0' if a specific character appears in my lookup sheet 'lookup exclusions' (and counts 1 if character does not appear)
AND
2/ Returns count '0' if a specific character is missing in a 2nd lookup sheet 'lookup inclusions' (and counts 1i f character does not appear)

Desired result formula 1
SAMPLEDQ.xlsx
AB
1ValueResult
2!Eduard0
3%Kim0
4Hans0
5L0
6Tim 0
7A\K|J0
8Hans@LED1
9Karen@LED%0
Results formula 1



Lookup exclusions
SAMPLEDQ.xlsx
A
1EXCLUSIONS
2!
3#
4##
5~
6%
7^
8&
9*
10(
11|
12\
13)
14_
15+
lookup exclusions


lookup inclusions
SAMPLEDQ.xlsx
A
1inclusions
2@
lookup inclusions



Formula 2
condition 1/ Returns count '0' if a specific character appears in my lookup sheet (and counts 1 if character does not appear)
AND
condition 2/ Returns count '0' if we have only 1 character in the cell (and counts 1 if more characters)

Desired result formula2
SAMPLEDQ.xlsx
AB
1ValueResult
2!Eduard0
3111Kim0
4Hans0
5L0
6Tim 1
7A\K|J0
Results formula 2


Lookup exclusions
SAMPLEDQ.xlsx
A
1EXCLUSIONS
2!
3#
4##
5~
6%
7^
8&
9*
10(
11|
12\
13)
14_
15+
lookup exclusions


I have already received help on the first condition: =(COUNT(0/FIND('lookup exclusions'!$A$2:$A$15,$A2))=0)*1
But am struggling to get in the second condition.

Thanks a lot for your help!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Formula 1

How about:

Dante Amor
AB
1ValueResult
2!Eduard0
3%Kim0
4Hans0
5L0
6Tim 0
7A\K|J0
8Hans@LED1
9Karen@LED%0
results formula 1
Cell Formulas
RangeFormula
B2:B9B2=IF(IFERROR(LOOKUP(2,1/SEARCH("~"&'lookup exclusions'!$A$2:$A$15,A2),ROW('lookup exclusions'!$A$2:$A$15)*0),1)*IFERROR(LOOKUP(2,1/SEARCH("~"&'lookup inclusions'!$A$2:$A$2,A2),ROW('lookup inclusions'!$A$2:$A$2)*1),0),1,0)
 
Upvote 0
Hi Dante, Thank you. I am not sure this is the expected result. I think I might have been unclear on my end.
I am looking for a formula with two conditions:
1/ That returns a 0 if any of the characters from 'lookup exclusions' is in the cell OR if the cell contains only one character (can be any character - nothing to do with the lookup exclusions)

If the cell doesn't contain any of my characters from 'lookup exclusions' or has more than one character than it should result in 1

Thanks for helping out - getting a bit desperate....
 

Attachments

  • String.jpg
    String.jpg
    18.4 KB · Views: 2
  • screen.jpg
    screen.jpg
    68.7 KB · Views: 2
Upvote 0
How about:

Dante Amor
AB
1ValueResult
2!Eduard0
3%Kim0
4Hans0
5L0
6Tim 0
7A\K|J0
8Hans@LED1
9Karen@LED%0
results formula 1
Cell Formulas
RangeFormula
B2:B9B2=IF(IFERROR(LOOKUP(2,1/SEARCH("~"&'lookup exclusions'!$A$2:$A$15,A2),ROW('lookup exclusions'!$A$2:$A$15)*0),1)*IFERROR(LOOKUP(2,1/SEARCH("~"&'lookup inclusions'!$A$2:$A$2,A2),ROW('lookup inclusions'!$A$2:$A$2)*1),0),1,0)
Hi Dante, Thank you. I am not sure this is the expected result. I think I might have been unclear on my end.
I am looking for a formula with two conditions:
1/ That returns a 0 if any of the characters from 'lookup exclusions' is in the cell OR if the cell contains only one character (can be any character - nothing to do with the lookup exclusions)

If the cell doesn't contain any of my characters from 'lookup exclusions' or has more than one character than it should result in 1

Thanks for helping out - getting a bit desperate....

Attachments​

  • String.jpg

  • screen.jpg
 
Upvote 0
Formula 1
condition 1/ Returns count '0' if a specific character appears in my lookup sheet 'lookup exclusions' (and counts 1 if character does not appear)
AND
2/ Returns count '0' if a specific character is missing in a 2nd lookup sheet 'lookup inclusions' (and counts 1i f character does not appear)

Desired result formula 1


The formula that I gave you is for what you requested as "formula 1".
The "formula2" is pending.
Check if what I gave you for "formula 1" is what you need.
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

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