Wildcard in IF statement

cpedcped

New Member
Joined
Apr 12, 2019
Messages
6
Hey there,

I know you cant really put a wildcard in a if statement but does anyone have any suggestions to get this formula to work?
=IFERROR(INDEX(Number; MATCH(0; COUNTIF(F$14:$F14;Number)+IF(Priority<>$C$3; 1; 0)+IF(SelectedCustomer<>Customer; 1; 0); 0)); "")

I want the selectedcustomer to be wildcard.. can also set that to a single cell as its just a named cell not a range.. Only the selectedcustomer should be wildcard

Reason for this is that I want to view unique numbers for all departments of the customer by just checking the customer name.

Best regards
Christian
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Tried out
=IFERROR(INDEX(Number; MATCH(0; COUNTIF(C$14:$C14;Number)+IF(Priority<>$C$3; 1; 0)+IF(LEFT('Page 1'!A:A;LEN($C$4))<>$C$4; 1; 0); 0)); "")

sadly didnt work, then it just showed randoms...

to explain what im trying to do.. im extracting the unique values from a column based on two criterias.. number is the named range of the numbers im trying to get.. priority is checked against selected priority and the last us customer which is selected in c4
 
Upvote 0
A small data sample (~10rows) along with criteria and expected results would be helpful.

M.
 
Upvote 0
A small data sample (~10rows) along with criteria and expected results would be helpful.

M.

Wasnt able to add attachment so i tried my best using a table.
If possible I want the list to show unique entries from column B based on 2 criterias(SelectedCustomer in B and SelectedPriority in D)
Also if possible i want if cell below selectedcustomer is empty then dont filter based on customer and if below selectedpriority is empty then list on 1 - Critical and 2 - High... If both selectedcustomer and selectedpriority was empty then it would show all numbers that are either high or critical.


ABCDE
1Customer 11231 - CriticalList:
2Customer 212344 - Low2222
3Customer 311113 - Moderate5555
4Customer 422222 - High1212
5Customer 433331 - Critical
6Customer 444443 - Moderate
7Customer 455552 - High
8Customer 366663 - Moderate
9Customer 377773 - Moderate
10Customer 188882 - High
11Customer 199993 - Moderate
12Customer 412122 - High
13
14SelectedCustomerSelectedPriority
15Customer 42 - High
16

<tbody>
</tbody>
 
Upvote 0
Hi

to be confirmed with control+shift+enter


=IFERROR(INDEX(C$1:C$12;MATCH(0;COUNTIF(F$1:F1;C$1:C$12)+IF(D$1:D$12<>$D$15;1;0)*(SelectedPriority<>"")+IF($B$15<>B$1:B$12;1;0)*(SelectedCustomer<>"");0));"")

The red segments should work as wildcards.

I'm using ";" as delimiters in the formula

Hope it helps
 
Last edited:
Upvote 0
Hey there,

Thanks for the reply.
It shows the unique values but the wildcard doesnt work. Say I write just Custom.. It should show everything.. The reason is that we have bunch of customers that are for example custom123,custom444, customer818.. i would want to be able to write just custom to show all of them as a whole.. if that makes sense.
 
Upvote 0
Hi

an attempt


=IFERROR(INDEX(C$1:C$12;MATCH(0;COUNTIF(F$1:F1;C$1:C$12)+IF(D$1:D$12<>$D$15;1;0)
+IF($B$15<>mid(B$1:B$12;1;len($b$15));1;0);0));"")

In B15 Customer # or Cust...

Regards



Excel 2010 32 bit
B
C
D
E
F
1
Customer 1
123​
1 - Critical
List:​
2
Customer 2
1234​
4 - Low
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F1,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
3
Customer 3
1111​
3 - Moderate
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F2,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
4
Customer 4
2222​
2 - High
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F3,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
5
Customer 4
3333​
1 - Critical
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F4,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
6
Customer 4
4444​
3 - Moderate
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F5,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
7
Customer 4
5555​
2 - High
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F6,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
8
Customer 3
6666​
3 - Moderate
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F7,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
9
Customer 3
7777​
3 - Moderate
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F8,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
10
Customer 1
8888​
2 - High
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F9,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
11
Customer 1
9999​
3 - Moderate
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F10,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
12
Customer 4
1212​
2 - High
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F11,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0),0)),"")​
13
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F12,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0)*($B$15<>"Customer"),0)),"")​
14
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F13,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0)*($B$15<>"Customer"),0)),"")​
15
Cust3 - Moderate
=IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F14,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>MID(B$1:B$12,1,LEN($B$15)),1,0)*($B$15<>"Customer"),0)),"")​
Sheet: Foglio1
 
Last edited:
Upvote 0
That worked brilliantly!

Are you able to add that if selectedpriority is not selected it will just show 2 - high and 1 - critical?

Best regards
Christian
 
Upvote 0
Hi

maybe
Code:
=[TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl63, width: 64"]IF(D$15="";IFERROR(INDEX(C$1:C$12;MATCH(0;COUNTIF(F$1:F1;C$1:C$12)+IF($D$1:$D$12<>$D$15;[COLOR=#ff0000]IF(LEFT(D$1:D$12)+0>2[/COLOR];1;0))+IF($B$15<>LEFT(B$1:B$12;LEN($B$15));1;0);0));"");IFERROR(INDEX(C$1:C$12;MATCH(0;COUNTIF(F$1:F1;C$1:C$12)+IF(D$1:D$12<>$D$15;1;0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12;LEN($B$15));1;0);0));""))[/TD]
[/TR]
</tbody>[/TABLE]




Excel 2010 32 bit

[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]B[/COLOR]​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]C[/COLOR]​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]D[/COLOR]​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]E[/COLOR]​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]F[/COLOR]​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]1[/COLOR]​
Customer 1
123​
1 - Critical
List:​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]2[/COLOR]​
Customer 2
1234​
4 - Low
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F1,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F1,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]3[/COLOR]​
Customer 3
1111​
3 - Moderate
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F2,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F2,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]4[/COLOR]​
Customer 4
2222​
2 - High
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F3,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F3,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]5[/COLOR]​
Customer 4
3333​
1 - Critical
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F4,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F4,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]6[/COLOR]​
Customer 4
4444​
3 - Moderate
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F5,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F5,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]7[/COLOR]​
Customer 4
5555​
2 - High
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F6,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F6,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]8[/COLOR]​
Customer 3
6666​
3 - Moderate
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F7,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F7,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]9[/COLOR]​
Customer 3
7777​
3 - Moderate
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F8,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F8,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]10[/COLOR]​
Customer 1
8888​
2 - High
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F9,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F9,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]11[/COLOR]​
Customer 1
9999​
3 - Moderate
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F10,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F10,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]12[/COLOR]​
Customer 4
1212​
2 - High
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F11,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F11,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]13[/COLOR]​
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F12,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F12,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]14[/COLOR]​
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F13,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F13,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​
[COLOR=[URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF"]#FFFFFF[/URL] ]15[/COLOR]​
Customer 4
=IF(D$15="",IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F14,C$1:C$12)+IF($D$1:$D$12<>$D$15,IF(LEFT($D$1:$D$12)+0>2,1,0))+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""),IFERROR(INDEX(C$1:C$12,MATCH(0,COUNTIF(F$1:F14,C$1:C$12)+IF(D$1:D$12<>$D$15,1,0)*($D$15<>"")+IF($B$15<>LEFT(B$1:B$12,LEN($B$15)),1,0),0)),""))​

<tbody>
</tbody>
Sheet: Foglio1

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,395
Messages
6,119,265
Members
448,881
Latest member
Faxgirl

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