Solved

Big huge IF Statement

Posted on 2011-02-17
9
214 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
  • 4
  • 3
  • 2
9 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:Seamus2626
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
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
Comment Utility
...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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
You guessed right!! Thanks
Seamus
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now