Brann
Brann

Reputation: 19

Excel: Need helping using the IF function in an excel formula

My function looks like this:

=CONCATENATE("[a href=""url", LEFT(J2,SEARCH(";",J2)-1), ".asp""]link text[/a]", "[/br][/br]", B2)

The LEFT/SEARCH function is taking the cell value of J2 up until the first semicolon. I'd like to incorporate an IF function in order to take the entire cell value of J2 if there is no semi colon. Any help would be greatly appreciated.

Upvotes: 0

Views: 104

Answers (2)

Rcoster
Rcoster

Reputation: 3210

Try:

=CONCATENATE("[a href=""url", LEFT(J2,IF(ISERROR(SEARCH(";",J2),LEN(J2),SEARCH(";",J2)-1))), ".asp""]link text[/a]", "[/br][/br]", B2)

Upvotes: 0

John Bustos
John Bustos

Reputation: 19574

Try this (assuming you have Excel 2007+):

=CONCATENATE("[a href=""url", IFERROR(LEFT(J2,SEARCH(";",J2)-1),J2), ".asp""]link text[/a]", "[/br][/br]", B2)

If not, let me know and i'll give you a different formula.

Upvotes: 1

Related Questions