Simplifying a formula

hnt007

Board Regular
Joined
Dec 18, 2021
Messages
98
Office Version
  1. 365
Platform
  1. MacOS
Hello and thanks for your help!

Is there a way to simplify this formula? =COUNTIF(C4,"*"&LEFT(C3,(FIND(" ",C3,1)-1))&"*")+COUNTIF(C4,"*"&MID(C3,FIND(" ",C3)+1,FIND(" ",C3,FIND(" ",C3)+1)-FIND(" ",C3))&"*")+COUNTIF(C4,"*"&TRIM(MID(SUBSTITUTE(C3," ",REPT(" ",100)),200,100))&"*")+COUNTIF(C4,"*"&TRIM(MID(SUBSTITUTE(C3, " ", REPT(" ", 999)), 2999, 999))&"*")+COUNTIF(C4,"*"&RIGHT(C3,LEN(C3)-FIND("~",SUBSTITUTE(C3," ","~",4)))&"*")>0

I need a smaller version of it to put in Conditional Formatting.

Track descriptions will all be different and I will never know what instruments are listed in advance, so that's why I'm using formulas to extract them. Here is the file Loading Google Sheets

Screen Shot 2022-05-16 at 8.32.14 PM.png
 
We could do the TEXTSPLIT part another way ....

AB
1
2Blah blah blah trumpet blah version - no trumpet piano gtr
3
4trumpet
5piano
6gtr
Sheet3
Cell Formulas
RangeFormula
B4:B6B4=LET(f,SEARCH("Version - no",B2),s,RIGHT(B2,LEN(B2)-f-12),m,MySplit(" "&s," ",99),MID(s,m,MySplit(s&" "," ",99)-m))
Dynamic array formulas.

MySplit: =LAMBDA(s,del,N,LET(MyDel,"@|^",f,FIND(MyDel,SUBSTITUTE(s,del,MyDel,SEQUENCE(N))),FILTER(f,ISNUMBER(f))))

This is just a first cut - it could be tidied up into the one LAMBDA. See if you can make it work?

I'll wait for the 14 new Text and Array functions.
Thanks for your help!
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
We could do the TEXTSPLIT part another way ....

AB
1
2Blah blah blah trumpet blah version - no trumpet piano gtr
3
4trumpet
5piano
6gtr
Sheet3
Cell Formulas
RangeFormula
B4:B6B4=LET(f,SEARCH("Version - no",B2),s,RIGHT(B2,LEN(B2)-f-12),m,MySplit(" "&s," ",99),MID(s,m,MySplit(s&" "," ",99)-m))
Dynamic array formulas.

MySplit: =LAMBDA(s,del,N,LET(MyDel,"@|^",f,FIND(MyDel,SUBSTITUTE(s,del,MyDel,SEQUENCE(N))),FILTER(f,ISNUMBER(f))))

This is just a first cut - it could be tidied up into the one LAMBDA. See if you can make it work?

I'll wait for the 14 new Text and Array functions.
Hi Stephen! The TextSplit function is now available on mac! YAY! How can I update your formula with it? Thank you so much
 
Upvote 0
The TextSplit function is now available on mac! YAY! How can I update your formula with it?
Like this perhaps?

AB
1
2Blah blah blah trumpet blah version - no trumpet piano gtr
3Blah blah blah blah version - no trumpet piano gtr
4Blah blah blah piano blah blah version - no trumpet piano gtr
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B4Expression=LET(s,"version - no ",MIN(SEARCH(TEXTSPLIT(TEXTAFTER(B2,s)," "),B2))<SEARCH(s,B2))textNO
 
Upvote 0
Solution
Like this perhaps?

AB
1
2Blah blah blah trumpet blah version - no trumpet piano gtr
3Blah blah blah blah version - no trumpet piano gtr
4Blah blah blah piano blah blah version - no trumpet piano gtr
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B4Expression=LET(s,"version - no ",MIN(SEARCH(TEXTSPLIT(TEXTAFTER(B2,s)," "),B2))<SEARCH(s,B2))textNO
WOW this is GENIUS! It works so well..thank you so much!!!
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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