Nested IF?

excel707

New Member
Joined
Dec 10, 2018
Messages
3
I am setting up a work schedule and I am trying to create a formula that will check to make sure that each day at least has a day (D) and a grave (G) shift assigned to an employee. If it does not have one of the two shifts, I would like for the missing shift to appear only in row 4. I think I may need a nested IF to accomplish this?

The latest formula I tried is:

=IF(ISNUMBER(FIND("D",Q6:Q11))=FALSE,"D",IF(ISNUMBER(FIND("G",Q6:Q11))=FALSE,"G",""))

As you can see, I have a D in Q7 but it still resulted in displaying a D in Q4....

I have figured out how to accomplish this when putting the results in two different rows but I would like to have the result come back in the same row. I successfully used the formulas below:
=IF(AND(I6<>"D",I7<>"D",I8<>"D",I9<>"D",I10<>"D",I11<>"D"),"D","")
=IF(AND(I6<>"G",I8<>"G",I9<>"G",I10<>"G",I11<>"G",I7<>"G"),"G","")

gX8SfG10
gX8SfG10
DG.jpg
 

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.
"to make sure each day has a D and G shift"

Where are your days listed? The diagram does not show separate days.
 
Upvote 0
Maybe
=IF(COUNTIF(C6:C11,"D")=0,"D",IF(COUNTIF(C6:C11,"G")=0,"G",""))
 
Upvote 0
You're welcome & thanks for the feedback.

I wouldn't say it has a particular name, but it's a type of nested formula in that you have functions inside other functions.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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