Drop Down List Formula

Rubber Beaked Woodpecker

Board Regular
Joined
Aug 30, 2015
Messages
203
Office Version
  1. 2021
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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
 
Upvote 0
Solution
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 :)
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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