How to use find function

yeat

New Member
Joined
Jan 25, 2022
Messages
18
Office Version
  1. 2019
Platform
  1. Windows
Hi, me again.

I want to ask how to use the "FIND" function.

this is my data
model
oppo red
oppo black
apple red

I want to make it to
model
oppo
oppo
apple

this is my formula, but I want multi colors
=LEFT(C7,LEN(C7) - LEN(MID(C7,FIND({"BLACK",C7),999)))
I try this, but not working
=LEFT(C7,LEN(C7) - LEN(MID(C7,FIND({"BLACK","WHITE"},C7),999)))

How to solve this problem, thank you in advance.:)
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Is this what you mean?

22 08 28.xlsm
CD
7modelmodel
8oppo redoppo
9oppo blackoppo
10apple redapple
yeat
Cell Formulas
RangeFormula
D7:D10D7=LEFT(C7,AGGREGATE(15,6,SEARCH({" red"," black"," white"},C7&" red"),1)-1)
 
Upvote 0
Solution
can you explain it?
The formula adds " red" after the original data so that at least one colour will be found.
SEARCH looks for a space followed by the listed colours. Each will return the position in the string where that is found or an error if the colour is not found.
AGGREAGATE(15,6 ... returns the smallest value from all the searches, (ignoring errors)
LEFT then cuts off the text before that first colour is found

Example with "oppo black"
First add the " red" gives "oppo black red"
SEARCH for " red", " black", " white" gives 11, 5, error
AGGREGATE(15, 6 returns 5
LEFT 1 character less gives "oppo"
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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