Solved

Update concatenated excel formula to include additional criteria

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding another criteria to an Excel formula 3 18
nested excel formula 5 29
Excel ActiveX ComboBox enters a 0 if a list item isn't selected 41 42
Print Wrapped Rows 3 20
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

685 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