ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Choose function not working (https://www.excelbanter.com/excel-discussion-misc-queries/452940-choose-function-not-working.html)

Dave1972

Choose function not working
 
Excel Masters,
I can't get my choose formula to work

=A2*(CHOOSE(INDEX(MATCH(B2,period,0),1),52,26,12,2 ))

Essentially doing up a home budgeting sheet that i can modify at some point.

what am I trying to achieve?

A2 is a payment amount

B2 is a drop down list of payment frequencies ie week, fortnight, month, bi-annual. This cell has the defined name of "period"

I did read on another forum that the INDEX function is not needed, however, this is how it stands at the moment. At this point, it will only calculate weekly no matter what period I choose from the drop down.....
Any suggestions?

Claus Busch

Choose function not working
 
Hi Dave,

Am Sat, 10 Dec 2016 09:55:38 +0000 schrieb Dave1972:

=A2*(CHOOSE(INDEX(MATCH(B2,period,0),1),52,26,12,2 ))


try:
=A2*VLOOKUP(period,{"week",52;"fortnight",26;"mont h",12;"bi-annual",2},2,0)


Regards
Claus B.
--
Windows10
Office 2016

Dave1972

Quote:

Originally Posted by Claus Busch (Post 1627637)
Hi Dave,

Am Sat, 10 Dec 2016 09:55:38 +0000 schrieb Dave1972:

=A2*(CHOOSE(INDEX(MATCH(B2,period,0),1),52,26,12,2 ))


try:
=A2*VLOOKUP(period,{"week",52;"fortnight",26;"mont h",12;"bi-annual",2},2,0)


Regards
Claus B.
--
Windows10
Office 2016

Hey there Claus,
Worked a treat...thank you. However...now I am intrigued....why didn't the other formula work? any clue?

Claus Busch

Choose function not working
 
Hi Dave,

Am Sun, 11 Dec 2016 09:59:47 +0000 schrieb Dave1972:

Worked a treat...thank you. However...now I am intrigued....why didn't
the other formula work? any clue?


period is only one cell. Therefore MATCH doesn't work.
If you have a range named "period" you can use CHOOSE(MATCH...)
Have a look:
https://1drv.ms/x/s!AqMiGBK2qniTgYM8Bn8SrF_p88VMVw
period is the named range R1:R4.


Regards
Claus B.
--
Windows10
Office 2016


All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com