How to obtain a multiple option text result

Matute

New Member
Joined
Sep 24, 2015
Messages
13
Hi all,

I need 1 formula to obtain a multiple text option result. As result i need to obtain the words "REINTEGRO" OR "HONORARIOS".
In 1 cell i will have the text "REINTEGRO ALUMNO GIOVANNI JUAN CASTRO" and in a different cell i will have a text as "HONORARIOS POR DICTADO DE CLASE" in the other cells the text will be different. But i need to quickly identfy those where "REINTEGRO" OR "HONORARIOS" are.


DETAILRESULT
FONDO TESORERIA REPOSICION
HONORARIOS POR DICTADO DE EXAMENHONORARIOS
REINTEGRO ALUMNOS GIOVANINI JUAN AGUSTOREINTEGRO

Thank you!!!!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
A vba solution

VBA Code:
Option Explicit

Sub Matute()
    Dim i As Long, lr As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lr
        If InStr(Range("A" & i), "HONORARIOS") > 0 Then
            Range("B" & i) = "HONORARIOS"
        ElseIf InStr(Range("A" & i), "REINTEGRO") > 0 Then
            Range("B" & i) = "REINTEGRO"
        End If
    Next i
End Sub
 
Upvote 0
you can try Power Query aka Get&Transform

Code:
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    Result = Table.AddColumn(Source, "Result", each if Text.Contains([DETAIL], "REINTEGRO") then "REINTEGRO" else if Text.Contains([DETAIL], "HONORARIOS") then "HONORARIOS" else null)
in
    Result

note: Power Query is case sensitive, so REINTEGRO <> Reintegro and so on....
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,627
Messages
6,120,610
Members
448,973
Latest member
ChristineC

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