A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
There are two basic ways to accomplish this. One way uses macros (you will have to macro enable your workbook) with this macro in the code behind the worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("A1")) Is Nothing Then
Application.EnableEvents = False
Select Case Me.Range("A1").Value
Case "A"
Me.Range("A1").Formula = "=1"
Case "B"
Me.Range("A1").Formula = "=2"
End Select
Application.EnableEvents = True
End If
End Sub
And, in cell A1, set up a dropdown validation list with the list of functions.
Another way without macros is to use a second cell for the dropdown and then, in the formula cell, use this formula:
=CHOOSE(MATCH(B1,{"A","B"},0),1,2)
And in cell B1 put a validation list drop down listing the various types of functions you want to use.
Kevin