If / ISNUMBER, instead out output true or false run another formula

SEASIA

New Member
Joined
Jul 23, 2022
Messages
15
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
Good morning

Lets say L17 contains either a C or P.
I need to determine if it is a C with If or isnumber....
If true, do another IF which should determine if E3 <= C3. If so give out OTM, If not, ITM. Er and B3 contains only a number. Depending if L17 contains a C it should do the formula, and then based on the outcome give out "ITM" ir OTM" If L17 doesn't contain a C then it is a P, and then use the formula above abut inverted as E3 >=C3.

So the basic formula is =(E3>=C3,"ITM","OTM"). But do this only if ISNUMBER or IF is true.

I red many posts which says; If cell contains specific text, then return a value. But instead a value in "" it should ru the little formula and then based on the outcome return ""

I'm struggling to add 2 IF statements into one formula. It seems, Excel wants output always as "whatever","whatever". Tried to combine it with , AND &. Any suggestions?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
So you want to do this basic formula if and only if L17 contains "C"?
Excel Formula:
=IF(L17="C",IF(E3>=C3,"ITM","OTM"))
What result do you want if L17 is "P"? (This formula will return FALSE)

I am not following what you mean by "if ISNUMBER or IF is true".
 
Upvote 0
So you want to do this basic formula if and only if L17 contains "C"?
Excel Formula:
=IF(L17="C",IF(E3>=C3,"ITM","OTM"))
What result do you want if L17 is "P"? (This formula will return FALSE)

I am not following what you mean by "if ISNUMBER or IF is true".
Yes, if there is no C there is a P. I thought since If formula gives out True and false, false would be automatically P and applies the other formula which is E3>=C3,"ITM","OTM. I hope that makes sense.

Right now I'm trying it this way; =IF(ISNUMBER(SEARCH(Sectors!L4,"P",)IF (E3>=C3),"ITM",), "No")
 
Upvote 0
Yes, if there is no C there is a P. I thought since If formula gives out True and false, false would be automatically P and applies the other formula which is E3>=C3,"ITM","OTM. I hope that makes sense.

Right now I'm trying it this way; =IF(ISNUMBER(SEARCH(Sectors!L4,"P",)IF (E3>=C3),"ITM",), "No")
The formula you posted looks interesting. =IF(L17="C",IF(E3>=C3,"ITM","OTM"))
How to add the second part in case there is a P instead of a C?

I tried based on your formula to add the second one; =IF(Sectors!L4="C",IF(E3>=C3,"ITM","OTM"))&IF(Sectors!L4="P",IF(E3<=C3,"ITM","OTM"))
the result is FALSEITM. I think instead a & it should be OR, but this doesn't work.
 
Last edited:
Upvote 0
I edited the formula this way: =IF(Sectors!L4="C","",IF(E3>=C3,"ITM","OTM"))&IF(Sectors!L4="P","",IF(E3<=C3,"ITM","OTM"))

It seems to work. However,
Is something wrong with the formula?
 
Upvote 0
Solution
OK I think I understand now after a careful re-read of your original post. Your latest formula will work but has superfluous logic.
Excel Formula:
=IF(L17="C",IF(E3>=C3,"ITM","OTM"),IF(E3<=C3,"ITM","OTM"))
This formula assumes that L17 must be "C" or "P".
 
Upvote 0
OK I think I understand now after a careful re-read of your original post. Your latest formula will work but has superfluous logic.
Excel Formula:
=IF(L17="C",IF(E3>=C3,"ITM","OTM"),IF(E3<=C3,"ITM","OTM"))
This formula assumes that L17 must be "C" or "P".
That's correct. the cell L17 has always a C or P. Nothing else is possible. So I think formula should be correct. Right? At least the outcome is correct.
 
Upvote 0
As I said, your formula gives the correct results, but mine has more compact logic.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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