# Question about Excel Worksheet Formula Syntax - Using {}

I have thefollowing formula. I would like to use reference cells for the parts of the formula which are in bold. So I would like to put D5 for the first Date and D6 for the second date.

=BDP(C5,"CUST_TRR_RETURN_HOLDING_PER ",{"CUST_TRR_START_DT","CUST_TRR_END_DT","CUST_TRR_CRNCY"},{20111230,20120816,"USD"},)/100

When I substitute those cells with the dates  I get an error which says "The formula typed contains an error")

I believe this is because I am not using the correct syntax.

How can I substitute the dates with actual cells?

Thanks
###### Who is Participating?

Commented:
Try using CHOOSE function in there, i.e.

=BDP(C5,"CUST_TRR_RETURN_HOLDING_PER ",{"CUST_TRR_START_DT","CUST_TRR_END_DT","CUST_TRR_CRNCY"},CHOOSE({1,2,3},D5,D6,"USD"),)/100

I'm assuming that D5 and D6 contain the values 20111230 and 20120816 (which are numbers not dates). If D5 and D6 contain dates then try this version instead

=BDP(C5,"CUST_TRR_RETURN_HOLDING_PER ",{"CUST_TRR_START_DT","CUST_TRR_END_DT","CUST_TRR_CRNCY"},CHOOSE({1,2,3},TEXT(D5,"yyyymmdd")+0,TEXT(D6,"yyyymmdd")+0,"USD"),)/100

regards, barry
0

Author Commented:
Thanks for the quick answer. The first formula works!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.