IF(OR Question

The Animal

Active Member
Joined
May 26, 2011
Messages
449
Hi
If someone can help
If the words "Part Time" or "Casual" is found in M17 then AZ17*Y17 but if "Salary" is found in M17 use the value in AZ17.
Thanks for any assistance

Stephen
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Code:
=IF(ISNUMBER(FIND("Salry",M17)),AZ17,IF(OR(ISNUMBER(FIND("Part Time",M17)),ISNUMBER(FIND("Casual",M17))),AZ17*Y17,"Please define"))
 
Upvote 0
Hi The Animal

Does this work for you:

Code:
=AZ17*IF(OR((IFERROR(FIND("Part Time",M17),0))=1,(IFERROR(FIND("Casual",M17),0))=1),Y17,1)

This assumes there are only three options in M17, being 'Part Time', 'Casual' and 'Salary', ie it does not check if 'Salary' is actually displayed.

Cheers

pvr928
 
Upvote 0
You didn't tell us whether those words would be the entire cell content or just part of a longer string. This should work for either case. Replace the ?? in red with what you want to be returned if none of the three strings are in M17.
Rich (BB code):
=IF(ISNUMBER(SEARCH("Salary",M17)),AZ17,IF(OR(ISNUMBER(SEARCH("Part Time",M17)),ISNUMBER(SEARCH("Casual",M17))),Y17*AZ17,"??"))
 
Upvote 0
Hi,

M1 formula assumes there are Only 3 possible words in M17, and are Not part of a longer Text String.
N1 formula assumes there are More than 3 possible words in M17, and are Not part of a longer Text String.
M2 formula assumes there are Only 3 possible words in M17, but may be part of a longer Text String.
N2 formula assumes there are More than 3 possible words in M17, but may be part of a longer Text String.


Book1
MNYZAZ
19090
29090
16
17Casual109
Sheet112
Cell Formulas
RangeFormula
M1=AZ17*IF(SUM(COUNTIFS(M17,{"Part Time","Casual"})),Y17,1)
M2=AZ17*IF(OR(ISNUMBER(SEARCH({"Part Time","Casual"},M17))),Y17,1)
N1=IF(M17="Salary",AZ17,IF(SUM(COUNTIFS(M17,{"Part Time","Casual"})),AZ17*Y17,"No Match"))
N2=IF(ISNUMBER(SEARCH("Salary",M17)),AZ17,IF(OR(ISNUMBER(SEARCH({"Part Time","Casual"},M17))),AZ17*Y17,"No Match"))
 
Last edited:
Upvote 0
Thanks so much
Used Joe's as per below with a few additions and if none of the 3 variables exist return a ""
=IF(ISNUMBER(SEARCH("Salary",M17)),AZ17,IF(OR(ISNUMBER(SEARCH("Part Time",M17)),ISNUMBER(SEARCH("Casual",M17))),(Y17*AZ17)+(AL17+AI17),""))
 
Upvote 0
My N2 formula in Post #5 does the same and is a "little bit" shorter.
 
Upvote 0
Hi Guys
Seem to be getting a #Value from below, How would it look if I wanted cell to display "" if AZ4 is ""
=IF(ISNUMBER(SEARCH("Salary",M4)),(AZ4+BC4+BB4),IF(OR(ISNUMBER(SEARCH("Part Time",M4)),ISNUMBER(SEARCH("Casual",M4))),(Y4*AZ4)+(AL4+AI4),""))

Thanks Stephen
 
Upvote 0
Try:
Code:
=IF(AZ4="","",IF(ISNUMBER(SEARCH("Salary",M4)),(AZ4+BC4+BB4),IF(OR(ISNUMBER(SEARCH("Part  Time",M4)),ISNUMBER(SEARCH("Casual",M4))),(Y4*AZ4)+(AL4+AI4),"")))
 
Upvote 0

Forum statistics

Threads
1,215,929
Messages
6,127,748
Members
449,402
Latest member
jvivo3

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