Solved

Update concatenated excel formula to include additional criteria

Posted on 2014-10-08
3
122 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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