Solved

# Question about Excel Worksheet Formula Syntax - Using {}

Posted on 2012-08-20
Medium Priority
2,796 Views
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
0
Question by:awesomejohn19

LVL 50

Accepted Solution

barry houdini earned 2000 total points
ID: 38311611
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 Closing Comment

ID: 38311656
Thanks for the quick answer. The first formula works!!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
###### Suggested Courses
Course of the Month13 days, 18 hours left to enroll