Formula in Dropdown menu

Trikson

Board Regular
Joined
Feb 10, 2014
Messages
61
Hi guys, I am not sure whether it is even possible, but where's a better place to ask than on MrExcel?

I have a following spreadsheet:

AB
1input 'W' if it is a work day
input 'R' if it is a rest day
Select reason only if necessary

<tbody>
</tbody>
2
3
4
5

<tbody>
</tbody>

Column B has a dropdown menu with 6 choices that is applicable only when R is entered into respective cell in column A. I have that part covered. However the requirement is also that if the work ends and rest starts, selecting one particular choice from the dropdown should trigger error message (others should work normally) . What's more important (and troublesome) is that it should only be the case for the first and last rest day.

Below is the example of the situation (column B now shows the choices available for each cell; for the sake of this example, let's assume that it is choice 1 that should not be allowed on first and last day of rest):

AB
1input 'W' if it is a work day
input 'R' if it is a rest day
Select reason only if necessary

<tbody>
</tbody>
2wno choice
3wno choice
4rchoice 2-6
5rchoice 1-6
6rchoice 1-6
7rchoice 2-6
8wno choice
9wno choice

<tbody>
</tbody>

Honestly I am stuck without any clue on how to put that part into a formula so any help will be appreciated

Thanks in advance!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Trikson,

Instead of showing the error message for choice 1 in some cells it's better not to show choice 1.

If I understand right you already use data validation for cells. Try to select range based on conditions. For example in your scenario the formula for data validation in C2 may look like this:
Code:
=IF(OR(A1="w";A3="w");$F$3:$F$7;$F$2:$F$7)
assuming that your "choice 1-6" is inside $F$2:$F$7 range and "choice 2-6" is inside $F$3:$F$7 range.
And just copy the cell down to stretch data validation

If you also want data validation to skip rows with "w" make another condition around:
Code:
=IF(A2="w";;IF(OR(A1="w";A3="w");$F$3:$F$7;$F$2:$F$7))
 
Upvote 0

Forum statistics

Threads
1,215,402
Messages
6,124,708
Members
449,182
Latest member
mrlanc20

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