Excel IF formula with various conditions

tropics123

Board Regular
Joined
May 11, 2016
Messages
85
Hi, any advice to get this formula to work is greatly appreciated. Assuming the header "Name" starts on cell A1.

Here is what I'm trying to do. For example, let's look at the employee named Bob. If his "Type of Employment" (column C) is:
1) Part time then the result will say "Category 2"
2) Seasonal then the result will say "Category 2"
3) Full time then the result will say "Category 2"
4) If it's none of those then the result will say "None"

Here's my formula. I only want to look up partial word such as "part" or "full" or "seasonal". At one point, the answer was showing "None" no matter what and then I tweaked it some more and now it doesn't work.

=IF(INDEX(A2:C5,MATCH("Bob",A2:A5,0),MATCH("Type of Employment",A1:C1,0))="*part*","Category 2",INDEX(A2:C5,MATCH("Bob",A2:A5,0),MATCH("Type of Employment",A1:C1,0))="*seasonal*","Category 2",INDEX(A2:C5,MATCH("Bob",A2:A5,0),MATCH("Type of Employment",A1:C1,0))="*full*","Category 1","None")


NameMemberType of Employment
BobYesPart time
MaryYesFull time
WoodyYesPart time
DylanNoSeasonal or Temp
 
Then hopefully like below.
I have put the type of employment in H as a separate formula. The formula in I1 references H1 three times. If you want to have a single formula then edit I1 and replace H1 with the formula in H1.

Book1
ABCDEFGHI
1Other StuffMemberType Of EmploymentNameDylanSeasonal or TempCategory2
2abcYesPart TimeBob
3999YesFull TimeMary
4xyzYesSpare PartWoody
5abcNoSeasonal or TempCharlie
6123NoCasualSid
7qwppNot SureBetty
8XXXXNoSeasonal or TempDylan
Sheet1
Cell Formulas
RangeFormula
H1H1=INDEX(A:D,MATCH(G1,INDEX(A:D,,MATCH("Name",$A$1:$D$1,0)),0),MATCH("Type Of Employment",$A$1:$D$1,0))
I1I1=IF(OR(ISNUMBER(SEARCH("part",H1,1)),ISNUMBER(SEARCH("seasonal",H1,1))),"Category2",IF(ISNUMBER(SEARCH("full",H1,1)),"Category1","None"))
 
Upvote 0

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.
Then hopefully like below.
I have put the type of employment in H as a separate formula. The formula in I1 references H1 three times. If you want to have a single formula then edit I1 and replace H1 with the formula in H1.

Book1
ABCDEFGHI
1Other StuffMemberType Of EmploymentNameDylanSeasonal or TempCategory2
2abcYesPart TimeBob
3999YesFull TimeMary
4xyzYesSpare PartWoody
5abcNoSeasonal or TempCharlie
6123NoCasualSid
7qwppNot SureBetty
8XXXXNoSeasonal or TempDylan
Sheet1
Cell Formulas
RangeFormula
H1H1=INDEX(A:D,MATCH(G1,INDEX(A:D,,MATCH("Name",$A$1:$D$1,0)),0),MATCH("Type Of Employment",$A$1:$D$1,0))
I1I1=IF(OR(ISNUMBER(SEARCH("part",H1,1)),ISNUMBER(SEARCH("seasonal",H1,1))),"Category2",IF(ISNUMBER(SEARCH("full",H1,1)),"Category1","None"))
@Snakehips
AWESOME! It worked wonderfully!! I combined the two formulas because that was exactly what I was looking for. Thank you so much for showing the formulas separately and explained how to combine them....that was the step I was missing. This will save me so much time. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

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