Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on 

IF/OR/AND Statement

Hi,
I have attached an IF statement i made that is failing on certain pieces of data.

I may have constructed it incorrectly

The logic of the the IF is:

IF A2= FIT or FIJ and J2 = buy, leave O2 as it is

IF A2= FIT or FIJ and J2 = sel, multiply O2*-1

IF A2 = SIT and J2 = Buy, multiply o2*-1

IF A2 = SIT and J2 = sel, leave O2 as it is

I have attached the IF below

Thanks
Seamus




test.xls
Microsoft Excel

Avatar of undefined
Last Comment
Norie
Avatar of Norie
Norie

The ORs are missing a cell reference.

Even if it's the same cell you are checking you still need that.

This,

OR(A1="FIJ","FIT")

should be this,

OR(A1="FIJ",A1="FIT")

That'll get rid of the #VALUE! error, don't know about the logic.:)

Use this formula...

=IF(OR(A1="FIT",A1="AIJ"),IF(J1="BUY",O1,O1*-1),IF(A1="SIT",IF(J1="Buy",O1*-1,O1),""))

Saurabh..
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Seamus2626
Seamus2626
Flag of Ireland image

ASKER

Rory squared up the logic as well as the formula, thank you all for suggestions.

Thanks
Seamus
Avatar of Norie
Norie

=IF(OR((A1="SIT")*(J1="BUY"), AND(OR(A1={"FIT","FIJ"}), J1="SEL")),-O1,O1)
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo