Replace part of the formula with pull-down menu choice

mc_mice

New Member
Joined
Dec 20, 2005
Messages
6
I need help with this issue:

I have a formula ( example =sum(A1) ) . I need the 1 to be configuratable from a pull-down menu. So, if I choose from the pull-down menu 4, the formula will print the summary from the cell A4

Thanks to all that will help
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hello, mc_mice
Welcome to the Board !!!!!

take a look at the function INDIRECT
=INDIRECT("A" & B1)where B1 houses you dropdownmenu
if B1 = 4 then the function will return the contents of A4

kind regards,
Erik
 
Upvote 0
Ok, the INDIRECT-command solved the issue partly, I should have been more precise:

- The data is on another sheet
- The command that I am using is

=SUM((COUNTIF(Sheet1!A3:A10;"1"));COUNTIF(Sheet1!A3:A10;"0"))

where I have to change the A to something else ( B,C etc.)

It seem that I cannot implement the INDIRECT to this formula
 
Upvote 0
but you can
Code:
=SUM((COUNTIF(INDIRECT("sheet1!" & A1 & "3:" & A1 & "10");"1"));COUNTIF(INDIRECT("sheet1!" & A1 & "3:" & A1 & "10");"0"))
A1 houses the column letter
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,891
Members
449,058
Latest member
Guy Boot

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