Avatar of ITSupportLCBT
ITSupportLCBTFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

excel formula with conditions

I'm working on an excel spread sheet with three columns. Both column A and column B contain some data. Column C is empty. I need to populate column C based on the content of columns A and B. Specifically:

If  the string 'ABC' exits s anywhere in  the contents of cell A1, then I need the content of cell C1 to be whatever the content of B1 is but pre-fixed with 'UK-'.  If 'ABC' does not exist in A1, then C1 should remain blank.

For example if the content of A1 is 'test-ABC' and the content of  B1 is 'cat' then C1 should become 'UK-cat'.


What is the formula that will allow me to do this please?
Microsoft Excel

Avatar of undefined
Last Comment
yogi4life
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of yogi4life
yogi4life
Flag of Norway image

Your formula which you can copy without changing it into all cells in column C is:

=IF(ISNA(VLOOKUP("*"&$G$1&"*";A1:A1;1;));"";"UK-"&B1)

Additionally I have attached a spreadsheet showing it....
Formula.xls
Avatar of yogi4life
yogi4life
Flag of Norway image

ha ha ... I was 27 seconds too late ... shouldnt have attached the spreadsheet .... :-))))
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo