Return specific text based on Alt+Enter (soft return) and braces

Country_Calc_2

New Member
Joined
Sep 16, 2023
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I want to return the following text with this logic

First choice: Any text between braces {adfadfadf}, does not matter which line
Second choice: Last line of text that is separated by Alt+Enter

Source DataDesired Result
Annovis Bio {QR Pharma}QR Pharma
NovartisNovartis
Cassava Sciences {Pain Therapeutics}Pain Therapeutics
National Institutes of Health/National Institute on Aging
Athira Pharma {M3 Biotechnology}
M3 Biotechnology
Eli LillyEli Lilly
National Institutes of Health/National Institute on Aging
Cassava Sciences {Pain Therapeutics}
Pain Therapeutics
(Other Cooperative Group)
Alzheimers Association
Vaccinex
Vaccinex
AC Immune
Johnson & Johnson/Janssen Biotech
Johnson & Johnson/Janssen Biotech
National Institutes of Health/National Institute on Aging
Alzheimers Association
T3D Therapeutics
T3D Therapeutics
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
MrExcelPlayground22.xlsx
ABC
2Annovis Bio {QR Pharma}QR PharmaQR Pharma
3NovartisNovartisNovartis
4Cassava Sciences {Pain Therapeutics}Pain TherapeuticsPain Therapeutics
5National Institutes of Health/National Institute on Aging Athira Pharma {M3 Biotechnology}M3 BiotechnologyM3 Biotechnology
6Eli LillyEli LillyEli Lilly
7National Institutes of Health/National Institute on Aging Cassava Sciences {Pain Therapeutics}Pain TherapeuticsPain Therapeutics
8(Other Cooperative Group) Alzheimers Association VaccinexVaccinex Vaccinex
9AC Immune Johnson & Johnson/Janssen BiotechJohnson & Johnson/Janssen Biotech Johnson & Johnson/Janssen Biotech
10National Institutes of Health/National Institute on Aging Alzheimers Association T3D TherapeuticsT3D Therapeutics T3D Therapeutics
Sheet9
Cell Formulas
RangeFormula
C2:C10C2=IFERROR(IFNA(TEXTAFTER(TEXTBEFORE(A2,"}"),"{"),MID(A2,MAX(IFERROR(SEARCH(CHAR(10),A2,SEQUENCE(LEN(A2))),0)),999)),A2)
 
Upvote 1
Solution
MrExcelPlayground22.xlsx
ABC
2Annovis Bio {QR Pharma}QR PharmaQR Pharma
3NovartisNovartisNovartis
4Cassava Sciences {Pain Therapeutics}Pain TherapeuticsPain Therapeutics
5National Institutes of Health/National Institute on Aging Athira Pharma {M3 Biotechnology}M3 BiotechnologyM3 Biotechnology
6Eli LillyEli LillyEli Lilly
7National Institutes of Health/National Institute on Aging Cassava Sciences {Pain Therapeutics}Pain TherapeuticsPain Therapeutics
8(Other Cooperative Group) Alzheimers Association VaccinexVaccinex Vaccinex
9AC Immune Johnson & Johnson/Janssen BiotechJohnson & Johnson/Janssen Biotech Johnson & Johnson/Janssen Biotech
10National Institutes of Health/National Institute on Aging Alzheimers Association T3D TherapeuticsT3D Therapeutics T3D Therapeutics
Sheet9
Cell Formulas
RangeFormula
C2:C10C2=IFERROR(IFNA(TEXTAFTER(TEXTBEFORE(A2,"}"),"{"),MID(A2,MAX(IFERROR(SEARCH(CHAR(10),A2,SEQUENCE(LEN(A2))),0)),999)),A2)

This works perfectly, thanks alot - hopefully it can help other users
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,982
Members
449,201
Latest member
Lunzwe73

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