Drop Down List Formula

Rubber Beaked Woodpecker

Board Regular
Joined
Aug 30, 2015
Messages
65
Office Version
  1. 2016
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 :)
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
12,414
Office Version
  1. 365
Platform
  1. Windows
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
 
Solution

Rubber Beaked Woodpecker

Board Regular
Joined
Aug 30, 2015
Messages
65
Office Version
  1. 2016
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 :)
 

Watch MrExcel Video

Forum statistics

Threads
1,127,119
Messages
5,622,834
Members
415,934
Latest member
adstocking

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
Top