+ Reply to Thread
Results 1 to 9 of 9

Can the CHOOSE function be used to have different calculations as its values?

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Can the CHOOSE function be used to have different calculations as its values?

    Can the CHOOSE function be used to have different calculations as its values?

    I have a requirement in which I need to use different calculations based on the MODE.
    I have the following as the MODES of Payment:

    YLY
    HLY
    QLY
    ECS
    SGL

    So, in the COlumn N from N2 till N6 contains different modes then can I use it like below:

    = choose(N2, YLY cal, HLY cal, QLY cal, ECS cal, 0)

    Is there a wauy of suing DEfined Names in the CHOOSE function..

    Regards
    e4excel
    Last edited by e4excel; 02-04-2011 at 06:39 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Can the CHOOSE function be used to have different calculations as its values?

    Presumably by MODE you mean mode of payment rather than MODE (as in the calculation)

    If you're saying these are strings (N2:N6) then yes you can use CHOOSE but you need to Match first to generate the index_num for CHOOSE

    Please Login or Register  to view this content.
    Of course if N2 is not any of these options then the above would error - you can use an appropriate handler to account for this

    Assuming pre XL2007 and a default of 0

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 02-04-2011 at 06:30 AM. Reason: missing SGL Cal

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can the CHOOSE function be used to have different calculations as its values?

    Actually, I need to do different calculations dynamically depending on the value of Mode in the cell N2...

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can the CHOOSE function be used to have different calculations as its values?

    Dear DO,

    please ignore my last message I whad not checked your reply..

    Regards
    e4excel

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can the CHOOSE function be used to have different calculations as its values?

    Quote Originally Posted by DonkeyOte View Post
    Presumably by MODE you mean mode of payment rather than MODE (as in the calculation)
    Yes MOde is Mode of payment and not the MODE function, I am sorry I should have been more explicit

    Quote Originally Posted by DonkeyOte View Post
    If you're saying these are strings (N2:N6) then yes you can use CHOOSE but you need to Match first to generate the index_num for CHOOSE


    =CHOOSE(MATCH(N2,{"YLY","HLY","QLY","ECS","SGL"},0),YLY Cal,HLY Cal,QLY Cal,ECS Cal,SGL Cal)
    Thanks a lot DO as always you are just amazing..!


    [= CHOOSE(MATCH(N2,{"YLY","HLY","QLY","ECS","SGL"},0), ]
    I used to always miss the coloured portion in your code and therefore was never comfortable using the CHOOSE function, but now that you explained it so well..

    I can use it..with good efect..

    Thanks a Lot^lot

    Regards
    e4excel
    Last edited by e4excel; 02-04-2011 at 06:42 AM.

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can the CHOOSE function be used to have different calculations as its values?

    Quote Originally Posted by e4excel View Post
    [B]
    Is there a way of using DEfined Names in the CHOOSE function..

    I tried Using Defined Names but it does not work so is there a workaround?
    As some calculations can consume lot of nestings..

    Regards
    e4excel

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Can the CHOOSE function be used to have different calculations as its values?

    @e4excel, the above provides very little in the way of meaningful information... along the lines of:

    I tried a formula - it didn't work - could you fix it ?

    You need to provide a lot more info. and preferably a sample file with Defined Names in place etc...

  8. #8
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can the CHOOSE function be used to have different calculations as its values?

    Dear DO,

    I always prefer to attach a sample file however due to the senstive nature of information, i an unable to upload a file....

    This work is related to Insurance Policy Databse..

    Regards
    E

  9. #9
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Can the CHOOSE function be used to have different calculations as its values?

    Thanka lot DO,

    I made a mistake it works with Defined Names as well..

    I was making some silly mistake somewhere!

    But it works and moreover i have now understood more about CHOOSE function..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1