Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Update concatenated excel formula to include additional criteria

Posted on 2014-10-08
3
Medium Priority
?
129 Views
Last Modified: 2014-10-09
Attached is a sample spreadsheet implementing a formula (in Column G). I would like this formula revised. Column I shows the desired results I am looking for. I've outlined the background details of the existing formula and included the updated criteria change at the end.

CRITERIA OF EXISTING FORMULA:
I would like Column G to concatenate different columns, including a specific string within one column, based on various criteria outlined below:

 If D = "CAD" or "TREP", AND H = "VOL 1" then Column G to concatenate as follows:
 G = B + D + C [first word after closing bracket OR first second word in string if no closing bracket] + F
 Otherwise, Column G to concatenate as follows:
 G = B + D + E + F

CURRENT FORMULA:
=IF(AND(H2="VOL 1",OR(D2="CAD",D2="TREP")),B2&"-"&D2&"-"&LEFT(TRIM(IF(FIND(")",C2)<>LEN(C2),MID(C2,FIND(")",C2)+1,100),MID(C2,FIND(" ",C2)+1,100))),FIND(" ",TRIM(IF(FIND(")",C2)<>LEN(C2),MID(C2,FIND(")",C2)+1,100),MID(C2,FIND(" ",C2)+1,100))))-1)&IF(F2<>"","-"&F2,""),B2&"-"&D2&IF(E2&F2="","","-"&E2&F2))

CRITERIA OF UPDATED FORMULA:
As above, except that H = "VOL 1" or "VOL 7" or "VOL 12" (formerly H = "VOL 1")

Thanks,
Andrea
EE-Sample-Concat-2Part-Updated.xlsx
0
Comment
Question by:Andreamary
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 2000 total points
ID: 40369307
Hi,

Try this (inserted in G2 and copied down):
=IF(AND(OR(H2="VOL 1",H2="VOL 7",H2="VOL 12"),OR(D2="CAD",D2="TREP")),B2&"-"&D2&"-"&LEFT(TRIM(IF(FIND(")",C2)<>LEN(C2),MID(C2,FIND(")",C2)+1,100),MID(C2,FIND(" ",C2)+1,100))),FIND(" ",TRIM(IF(FIND(")",C2)<>LEN(C2),MID(C2,FIND(")",C2)+1,100),MID(C2,FIND(" ",C2)+1,100))))-1)&IF(F2<>"","-"&F2,""),B2&"-"&D2&IF(E2&F2="","","-"&E2&F2))

I've bolded the key change to your formula.

Regards,
-Glenn
0
 

Author Closing Comment

by:Andreamary
ID: 40371297
Thanks very much, Glenn!
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40371313
You are welcome.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question