Need help for Excel formula - If and Or

asdafgafawaaa

New Member
Joined
Jun 23, 2017
Messages
19
Hi Excel Gurus,

I'm trying to write a formula in my report as below, but it only returns error "#VALUE!".

There are the scenarios:
If the value is a number or contains "-", equals L12
If else, leave it empty.

=IF(OR(ISNUMBER(E12),FIND("-",E12)>1),L12,"")
=IF(OR(ISNUMBER(E12)="TRUE",FIND("-",E12)>1),L12,"")

Can you please explain how to make it work?

Thank you in advance!
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
The issue is that if FIND does not find anything, it returns an error.
Try this:
Code:
=IF(OR(ISNUMBER(E12),ISNUMBER(FIND("-",E12))),L12,"")
 
Upvote 0
Your first formula wont work if there is no hyphen in the number ... so basically wrap an iferror and set it to 0 if there is an error

=IF(OR(ISNUMBER(E12), IFERROR( FIND("-",E12),0)>1),L12,"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,545
Messages
6,125,450
Members
449,227
Latest member
Gina V

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