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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
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,215,374
Messages
6,124,566
Members
449,171
Latest member
jominadeo

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