Help with changing formula to shorter one

Schturman

Board Regular
Joined
May 28, 2022
Messages
63
Office Version
  1. 2019
Platform
  1. Windows
Hello
I use this formula to check if name exist 1 or more times (see pic 1)

Excel Formula:
=IF($D68="","",IF(COUNTIF($D$7:$H$12,"*"&$D68&"*")>=1," "&$D68&" !"," "&$D68))

1711564416206.png


And if it exist it will add sign "!" to the name in the output.
Formula in the cell: E68
Names in cell (1): D68
Range for checking (2): D7:H12

Now I added new parameter for checking, Range I7:I12 and use this formula:

Excel Formula:
=IF($D68="","",IF(AND(COUNTIF($D$7:$H$7,"*"&$D68&"*")>=1,$I$7="")," "&$D68&" !",IF(AND(COUNTIF($D$8:$H$8,"*"&$D68&"*")>=1,$I$8="")," "&$D68&" !",IF(AND(COUNTIF($D$9:$H$9,"*"&$D68&"*")>=1,$I$9="")," "&$D68&" !",IF(AND(COUNTIF($D$10:$H$10,"*"&$D68&"*")>=1,$I$10="")," "&$D68&" !",IF(AND(COUNTIF($D$11:$H$11,"*"&$D68&"*")>=1,$I$11="")," "&$D68&" !",IF(AND(COUNTIF($D$12:$H$12,"*"&$D68&"*")>=1,$I$12="")," "&$D68&" !"," "&$D68)))))))

that will check if in the range I7:I12 exists word "Canceled" the name in the same row stay without sign "!" in output (see pic 2)

1711564565823.png


Now if I will add the same name in another row in the same range D7:H12, it will add again sign "!" to the name in output (see pic 3)

1711564582815.png


My formula working perfectly, but my question is if I can do it in another way and get more elegant and shorter formula ?
I tried with vlookup and xlookup, but without a correct result... maybe I used it wrong...
Thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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