?
Solved

Big huge IF Statement

Posted on 2011-02-17
9
Medium Priority
?
222 Views
Last Modified: 2012-06-22
Hi,

I have a big IF Statement (As below) I need to bring an extra condition in but am not sure how.

I need the extra condition to be : IF AT2 ="New Break requires investigation (1-3 day),""

AP2 = "New Break requires investigation (1-3 day)"

My current conditions are IF are below

Thanks!

Seamus

=IF(OR(TRIM(SUBSTITUTE(AP2,CHAR(160),""))="Fidessa Booking instructed, Awaiting Sophis Booking",TRIM(SUBSTITUTE(AP2,CHAR(160),""))="Re - Allocated to different Source code",TRIM(SUBSTITUTE(AP2,CHAR(160),""))="No Narrative Provided",TRIM(SUBSTITUTE(AP2,CHAR(160),""))="Open Investigation",TRIM(SUBSTITUTE(AP2,CHAR(160),""))="fidessa booking to be made",TRIM(SUBSTITUTE(AP2,CHAR(160),""))="Corporate Actions Booking Adjustment required",TRIM(SUBSTITUTE(AP2,CHAR(160),""))="Paris being involved in resolution",TRIM(SUBSTITUTE(AP2,CHAR(160),""))="New break requires investigatation (1 - 3 day)"),TRIM(SUBSTITUTE(AP2,CHAR(160),"")), "No Narrative Provided")



0
Comment
Question by:Seamus2626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34917027
I don't understand your new condition.

Incidentally, if you added another column to clean up column AP, your formula could be a lot shorter!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34917063
Hello Seamus,

Can you specify the new condition in words - it looks like you are saying that if AT2 is the same as that text then AP2 should be blank is that right? Does that take precedence over the existing formula, e.g. should AT2 be checked fiirst and that part actioned, or would you check the formula first.

That's the problem with IFs......if the conditions aren't mutually exclusive you need to specify the pririty order.

 regards, barry
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34917118
You could shorten the existing formula even without any other cells, i.e.

=IF(OR(TRIM(SUBSTITUTE(AP2,CHAR(160),""))={"Fidessa Booking instructed, Awaiting Sophis Booking","Re - Allocated to different Source code","No Narrative Provided","Open Investigation","fidessa booking to be made","Corporate Actions Booking Adjustment required","Paris being involved in resolution","New break requires investigatation (1 - 3 day)"}),TRIM(SUBSTITUTE(AP2,CHAR(160),"")), "No Narrative Provided")

but I'm still unsure how you want to add the extra bit......

regards, barry
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Seamus2626
ID: 34917135
Thanks guys, this IF does have prirority and it is

(1) IF AT2 ="New Break requires investigation (1-3 day),""  then

AP2 = New Break requires investigation (1-3 day)

Then (2)

The IF Statement

Thanks
Seamus
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34917158
I still don't follow. You can't assign a value to AP2 from a formula in a different cell.
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34917171
...but AP2 is the cell that the original formula references - you can't change AP2 by formula unless that formula is in AP2 ....and you already have data in there.

Where does the huge formula reside now?

regards, barry
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 34917241
My best guess would be this

=IF(AT2 ="New Break requires investigation (1-3 day)",AT2,IF(OR(TRIM(SUBSTITUTE(AP2,CHAR(160),""))={"Fidessa Booking instructed, Awaiting Sophis Booking","Re - Allocated to different Source code","No Narrative Provided","Open Investigation","fidessa booking to be made","Corporate Actions Booking Adjustment required","Paris being involved in resolution","New break requires investigatation (1 - 3 day)"}),TRIM(SUBSTITUTE(AP2,CHAR(160),"")), "No Narrative Provided"))

That will return the value of AT2 if AT2 = "New Break requires investigation (1-3 day)", otherwise the original formula runs

regards, barry
0
 

Author Comment

by:Seamus2626
ID: 34917249
Oh shit ive noticed im saying AP2, feck, the Big IF Statement is in A02

AP is a Trim and Find formula
AT is an IF statement formula

So in the IF in AO2, it needs to use AT2 as preference, if AT2 is blank, then move back to the big IF!

Sorry!
0
 

Author Closing Comment

by:Seamus2626
ID: 34917447
You guessed right!! Thanks
Seamus
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

649 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