# Drop Down List Formula

#### Rubber Beaked Woodpecker

##### Board Regular
In T145 I have the following formula: =INDEX(AC4:AE141,MATCH(U145,AC4:AC141,FALSE),3)

This formula calculates the days possible commission payments.

I would like the option of overwriting the commission payment in cell T145 by using a drop down list containing the test "X" but if I decide to remove the X the cell reverts back to the formula =INDEX(AC4:AE141,MATCH(U145,AC4:AC141,FALSE),3).

At present if the X is selected the formula is lost.

Hope this makes sense and any help would be greatly appreciated

### Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

#### jasonb75

##### Well-known Member
The selected value of the dropdown is a constant, you can have either a constant or a formula in a cell, not both.

The only alternative would be to replace the formula with vba when the content of the cell is deleted, something like this in the worksheet module (untested)
VBA Code:
``````Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 And Target.Address(0, 0) = "T145" Then
If Target.Value = "" Then
Target.Formula = "=INDEX(AC4:AE141,MATCH(U145,AC4:AC141,FALSE),3)"
End If
End If
End Sub``````

#### Rubber Beaked Woodpecker

##### Board Regular
The selected value of the dropdown is a constant, you can have either a constant or a formula in a cell, not both.

The only alternative would be to replace the formula with vba when the content of the cell is deleted, something like this in the worksheet module (untested)
VBA Code:
``````Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 And Target.Address(0, 0) = "T145" Then
If Target.Value = "" Then
Target.Formula = "=INDEX(AC4:AE141,MATCH(U145,AC4:AC141,FALSE),3)"
End If
End If
End Sub``````
Hi thanks.
Unfortunately I am unable to use VBA as the spreadsheet is mainly used via the Excel mobile app. I guess my request is not possible.
Thank you for the VBA solution

Replies
3
Views
75
Replies
5
Views
76
Replies
13
Views
196
Replies
4
Views
233
Replies
0
Views
208

1,127,164
Messages
5,623,109
Members
415,955
Latest member
ssheldon2021

### 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.

### Which adblocker are you using?

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

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