Choose Formula

mpapreja

New Member
Joined
Jan 26, 2019
Messages
4
Dear Experts

I am using a choose Formula as follows:

CHOOSE((VALUE(F2733)>0)+(VALUE(F2733) > 50)+(VALUE(F2733)>145)+(VALUE(F2733)>500)+(VALUE(F2733)>750)+(VALUE(F2733)>1000),0.65,0.6,0.55,0.5,0.45,0.4)

At the end of formula I have few fixed factors which i want to name as Set A, Set B, Set C as follows:-

Set A0.65,0.6,0.55,0.5,0.45,0.4
Set B0.7,0.65,0.6,0.55,0.5,0.45
Set C0.6,0.55,0.5,0.45,0.4,0.35

<colgroup><col><col></colgroup><tbody>
</tbody>


Now I want to use the choose formula as follows for various sets as state above:-

CHOOSE((VALUE(F2733)>0)+(VALUE(F2733) > 50)+(VALUE(F2733)>145)+(VALUE(F2733)>500)+(VALUE(F2733)>750)+(VALUE(F2733)>1000),Set A)

CHOOSE((VALUE(F2733)>0)+(VALUE(F2733) > 50)+(VALUE(F2733)>145)+(VALUE(F2733)>500)+(VALUE(F2733)>750)+(VALUE(F2733)>1000),Set B)

CHOOSE((VALUE(F2733)>0)+(VALUE(F2733) > 50)+(VALUE(F2733)>145)+(VALUE(F2733)>500)+(VALUE(F2733)>750)+(VALUE(F2733)>1000),Set C)

Is it possible? Can somebody help in this regard?
 

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
Hi & welcome to MrExcel
Maybe something like
=IF(VALUE(F4)>0,0.65-(SUM(VALUE(F4)>50,VALUE(F4)>145,VALUE(F4)>500,VALUE(F4)>750,VALUE(F4)>1000)*0.05),"")
=IF(VALUE(F4)>0,0.7-(SUM(VALUE(F4)>50,VALUE(F4)>145,VALUE(F4)>500,VALUE(F4)>750,VALUE(F4)>1000)*0.05),"")
=IF(VALUE(F4)>0,0.6-(SUM(VALUE(F4)>50,VALUE(F4)>145,VALUE(F4)>500,VALUE(F4)>750,VALUE(F4)>1000)*0.05),"")
 
Upvote 0
Thanks for responding promptly to resolve my problem. Pl. be informed that my formula

CHOOSE((VALUE(F2733)>0)+(VALUE(F2733) > 50)+(VALUE(F2733)>145)+(VALUE(F2733)>500)+(VALUE(F2733)>750)+(VALUE(F2733)>1000),0.65,0.6,0.55,0.5,0.45,0.4)

is working perfectly as per my requirement. The only thing i want to enhance in this formula is to replace "0.65,0.6,0.55,0.5,0.45,0.4" with variables like SetA, SetB and so on, so that whenever i make changes in SetA my choose formula should be updated accordingly.

Hope I am more clear now.



Hi & welcome to MrExcel
Maybe something like
=IF(VALUE(F4)>0,0.65-(SUM(VALUE(F4)>50,VALUE(F4)>145,VALUE(F4)>500,VALUE(F4)>750,VALUE(F4)>1000)*0.05),"")
=IF(VALUE(F4)>0,0.7-(SUM(VALUE(F4)>50,VALUE(F4)>145,VALUE(F4)>500,VALUE(F4)>750,VALUE(F4)>1000)*0.05),"")
=IF(VALUE(F4)>0,0.6-(SUM(VALUE(F4)>50,VALUE(F4)>145,VALUE(F4)>500,VALUE(F4)>750,VALUE(F4)>1000)*0.05),"")
 
Upvote 0
The only thing i want to enhance in this formula is to replace "0.65,0.6,0.55,0.5,0.45,0.4" with variables like SetA, SetB and so on, so that whenever i make changes in SetA my choose formula should be updated accordingly.
You cannot do what you want with the CHOOSE function... its argument is a comma delimited list which, like all functions with such arguments, cannot be "broken" into separate parts. You can use the INDEX function to achieve the functionality that you want though. First, bring up the Name Manager dialog box (located on the Formula tab, Defined Names group), then click the "New..." button and type SetA in the "Name" field and ={0.65,0.6,0.55,0.5,0.45,0.4} in the "Refers to" field, then click OK. While the dialog box is still up, repeat the above process for SetB and SetC. Now that you have the defined names, you can use this formula for SetA...
Code:
[table="width: 500"]
[tr]
	[td]=INDEX(SetA,VALUE(F2733)>0)+(VALUE(F2733)>50)+(VALUE(F2733)>145)+(VALUE(F2733)>500)+(VALUE(F2733)>750)+(VALUE(F2733)>1000)[/td]
[/tr]
[/table]
And you can now replace SetA with either SetB or SetC and it will work as your original formula did. Note that this version of the INDEX function is using the identical arguments you wanted to use for the CHOOSE function except that their positions in the argument list are reversed.
 
Last edited:
Upvote 0
Thanks Rick but I am not getting desired results Following are the results using index function

(INDEX({0.7,0.68,0.67,0.65,0.6,0.55},VALUE(C7)>0)+(VALUE(C7)>50)+(VALUE(C7)>145)+(VALUE(C7)>500)+(VALUE(C7)>750)+(VALUE(C7)>1000))

if is use {0.7,0.68,0.67,0.65,0.6,0.55} as one of the sets:-

ValueResult
1
0.70
51 1.70
150 2.70
501 3.70
751 4.70
1001 5.70

<colgroup><col style="width:48pt" width="64" span="2"> </colgroup><tbody>
</tbody>


whereas the result is intended to be as follows using Choose function

(CHOOSE((VALUE(C7)>0)+(VALUE(C7) > 155)+(VALUE(C7)>315)+(VALUE(C7)>500)+(VALUE(C7)>750)+(VALUE(C7)>1000),0.7,0.68,0.67,0.65,0.6,0.55)):-

ValueResult
1 0.70
51 0.70
150 0.70
501 0.65
751 0.60
1001 0.55

<colgroup><col span="2"></colgroup><tbody>
</tbody>









You cannot do what you want with the CHOOSE function... its argument is a comma delimited list which, like all functions with such arguments, cannot be "broken" into separate parts. You can use the INDEX function to achieve the functionality that you want though. First, bring up the Name Manager dialog box (located on the Formula tab, Defined Names group), then click the "New..." button and type SetA in the "Name" field and ={0.65,0.6,0.55,0.5,0.45,0.4} in the "Refers to" field, then click OK. While the dialog box is still up, repeat the above process for SetB and SetC. Now that you have the defined names, you can use this formula for SetA...
Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD]=INDEX(SetA,VALUE(F2733)>0)+(VALUE(F2733)>50)+(VALUE(F2733)>145)+(VALUE(F2733)>500)+(VALUE(F2733)>750)+(VALUE(F2733)>1000)
[/TD]
[/TR]
</tbody>[/TABLE]
And you can now replace SetA with either SetB or SetC and it will work as your original formula did. Note that this version of the INDEX function is using the identical arguments you wanted to use for the CHOOSE function except that their positions in the argument list are reversed.
 
Upvote 0
Thanks Rick but I am not getting desired results Following are the results using index function

(INDEX({0.7,0.68,0.67,0.65,0.6,0.55},VALUE(C7)>0)+(VALUE(C7)>50)+(VALUE(C7)>145)+(VALUE(C7)>500)+(VALUE(C7)>750)+(VALUE(C7)>1000))

if is use {0.7,0.68,0.67,0.65,0.6,0.55} as one of the sets:-

ValueResult
1 0.70
51 1.70
150 2.70
501 3.70
751 4.70
1001 5.70

<tbody>
</tbody>


whereas the result is intended to be as follows using Choose function

(CHOOSE((VALUE(C7)>0)+(VALUE(C7) > 155)+(VALUE(C7)>315)+(VALUE(C7)>500)+(VALUE(C7)>750)+(VALUE(C7)>1000),0.7,0.68,0.67,0.65,0.6,0.55)):-

ValueResult
1 0.70
51 0.70
150 0.70
501 0.65
751 0.60
1001 0.55

<tbody>
</tbody>
You were not using the same logical expression in the two formula. Assuming your CHOOSE function formula is correctly structured, here is what your INDEX function formula should be...
Code:
[table="width: 500"]
[tr]
	[td]=INDEX({0.7,0.68,0.67,0.65,0.6,0.55},(VALUE(C7)>0)+(VALUE(C7) > 155)+(VALUE(C7)>315)+(VALUE(C7)>500)+(VALUE(C7)>750)+(VALUE(C7)>1000))[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0
Perfect!! It was my mistake but now it is working. One more related question if you can help!

i am hard coding various conditions like C7>0, C7>155, C7>315, C7>500, C7>750, C7>1000 ........ in the formula being used.

is it possible someway to link these conditions with my various sets withing the suggested formula like

Set A means
0.7,0.68,0.67,0.65,0.6,0.55 and 0,155,315, 500,750,1000

Set B Means
0.7,0.68,0.67,0.65,0.6,0.55 and 0,50,145, 500, 750,1000

Many Thanks for your assistance. Also confirm how to mark the above answer as an answer.
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,859
Members
449,194
Latest member
HellScout

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