if Function

ChetanPuri

Board Regular
Joined
Sep 5, 2018
Messages
62
Office Version
  1. 365
Platform
  1. Windows
Hi team,

I am trying to create an if formula, if column C20 = Saturday, then Saturday or Sunday, and if Column B20 includes Sleepover then instead of Saturday or Sunday include Sleepover, other than that use same value in Column B. Not Sure why the formula doesn't work. Any help would be appreciated

Book3
ABC
1MondayNight shiftNight shift
2TuesdayNight shiftNight shift
3WednesdayNight shiftNight shift
4ThursdayNight shiftNight shift
5FridayNight shiftNight shift
6SaturdayNight shiftSaturday
7SundayNight shiftSunday
8MondayNight shiftNight shift
9TuesdayNight shiftNight shift
10WednesdaySleepoverSleepover
11ThursdaySleepoverSleepover
12FridaySleepoverSleepover
13SaturdaySleepoverSaturday
14SundaySleepoverSunday
15MondaySleepoverSleepover
16TuesdaySleepoverSleepover
17WednesdaySleepoverSleepover
18ThursdaySleepoverSleepover
19FridaySleepoverSleepover
20SaturdaySleepoverSaturday
21SundaySleepoverSunday
22MondaySleepoverSleepover
23TuesdaySleepoverSleepover
24WednesdayDay shiftDay shift
25ThursdayDay shiftDay shift
26FridayDay shiftDay shift
27SaturdayDay shiftSaturday
Sheet1
Cell Formulas
RangeFormula
C1:C27C1=IF(A1="Saturday","Saturday",IF(A1="Sunday","Sunday",IF(B1="Sleepover","Sleepover",B1)))
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi, it's not that clear to me from your description, so here's a bit of a guess. If this isn't it, re-post your example data, but complete column C manually with your expected results.

Book1
ABC
1MondayNight shiftMonday
2TuesdayNight shiftTuesday
3WednesdayNight shiftWednesday
4ThursdayNight shiftThursday
5FridayNight shiftFriday
6SaturdayNight shiftSaturday
7SundayNight shiftSunday
8MondayNight shiftMonday
9TuesdayNight shiftTuesday
10WednesdaySleepoverWednesday
11ThursdaySleepoverThursday
12FridaySleepoverFriday
13SaturdaySleepoverSleepover
14SundaySleepoverSleepover
15MondaySleepoverMonday
16TuesdaySleepoverTuesday
17WednesdaySleepoverWednesday
18ThursdaySleepoverThursday
19FridaySleepoverFriday
20SaturdaySleepoverSleepover
21SundaySleepoverSleepover
22MondaySleepoverMonday
23TuesdaySleepoverTuesday
24WednesdayDay shiftWednesday
25ThursdayDay shiftThursday
26FridayDay shiftFriday
27SaturdayDay shiftSaturday
Sheet1
Cell Formulas
RangeFormula
C1:C27C1=IF(AND(OR(A1={"Saturday","Sunday"}),B1="Sleepover"),B1,A1)
 
Upvote 0
This is my guess as to what you need:
=IF(B1="Sleepover",B1,IF(OR(A1={"Saturday","Sunday"}),A1,B1))
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,657
Members
449,462
Latest member
Chislobog

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