Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you perform a conditional concatenate in Excel? 1

Status
Not open for further replies.

PaultheITGuy

Technical User
Jan 19, 2007
52
GB
Hello,

I have created a fairly basic spreadsheet to keep tabs on all the sheet music I use with my band at church.

Often songs and hymns are sorted in books by their first line rather than their actual published title (e.g. the song "God Of Wonders" is sorted by its first line "Lord Of All Creation") and therefore I want to record both. Column A is called "First Line" and column B is "Title (If Different)".

I have a concatenate function in column C which combine these by listing the First Line, then a space, and then the Title in parenthesis so the finished result would look like this "Lord Of All Creation (God Of Wonders).

However, some songs (e.g. Deliverer) use their First Line as the Title and this means column A is populated but column B is blank and column C looks like this "Deliverer ()"

My current formula is

=CONCATENATE(A4, " (",B4,")")

and I have just used

=A4

for 'first line only' songs but this looks untidy as it brings up those annoying little green triangles which question your use of different formula in consecutive cells.

Can anyone tell me if there is there a way to adjust the formula so that if the Title in Column B is blank then it does not put the " ()" in but if it is populated then it includes them?

I'd be grateful for advice on this.

Many thanks

Paul C
 
Should be something like this
Code:
=IF(ISBLANK(B4);A4;CONCATENATE(A4, " (",B4,")"))

Cheers,
Dian
 
Or,

=A4&IF(B4<>""," ("&B4&")","")


Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
My pleasure. :-D

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top