Nesting LEFT into an OR formula

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
306
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Cheers!
I'm trying to incorporate a LEFT function into the following formula so it will look at only the first two digits of CSV!J3 for the numbers 4,5,8,10,11.

=IF(OR(CSV!J3={4,5,8,10,11}),((0.1005*TAN((PI()/180)*(90-(CSV!Z3/2))))-(0.0693*SIN((PI()/180)*(90-CSV!Z3/2))))*2,0)

I tried

=IF(OR(LEFT(CSV!J3={4,5,8,10,11},2)),((0.1005*TAN((PI()/180)*(90-(CSV!Z3/2))))-(0.0693*SIN((PI()/180)*(90-CSV!Z3/2))))*2,0)
but I get a VALUE! error. Can anyone help me fix this?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
The left function returns a text, now you have to ask for a text
Try:


=IF(OR(LEFT(CSV!J3,2)={"04","05","08","10","11"}),((0.1005*TAN((PI()/180)*(90-(CSV!Z3/2))))-(0.0693*SIN((PI()/180)*(90-CSV!Z3/2))))*2,0)

or

=IF(OR(VALUE(LEFT(CSV!J3,2))={4,5,8,10,11}),((0.1005*TAN((PI()/180)*(90-(CSV!Z3/2))))-(0.0693*SIN((PI()/180)*(90-CSV!Z3/2))))*2,0)
 
Last edited:
Upvote 0
deleted

Better solution already provided
 
Last edited:
Upvote 0
Fantastic! The second suggestion worked best. It recognized entries both with and without the extra fluff after the first two digits.
Thank you!
 
Upvote 0
Try...

=IF(ISNUMBER(MATCH(LEFT(CSV!J3,2)+0),{4,5,8,10,11},0)),((0.1005*TAN((PI()/180)*(90-(CSV!Z3/2))))-(0.0693*SIN((PI()/180)*(90-CSV!Z3/2))))*2,0)
 
Upvote 0
Fantastic! The second suggestion worked best. It recognized entries both with and without the extra fluff after the first two digits.
Thank you!


I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top