Results 1 to 7 of 7

Thread: Inserting value from cell in another cell within quotes

  1. #1
    New Member
    Join Date
    Sep 2019
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Inserting value from cell in another cell within quotes

    Hi all, I have a question that may be very basic, but I'm stumped. I have a list of thousands of values (CUSIP data), and I need the information in these cells for another formula. For example, cell A2 could be 99934U0F2, and I need that information to go into another formula in cell B2: =BDP("99934U0F2 CUSIP, "CNTRY_OF_DOMICILE").

    Now I can copy-paste the value from A2 inside the cell and then paste it into the formula in B2, but I have thousands of these that I need to run. My issue is inserting the value of another cell within quotations marks, since the second =BDP formula has to have the quotes.

    Any suggestions and help are very welcome. Thank you!

  2. #2
    Board Regular Toadstool's Avatar
    Join Date
    Mar 2018
    Posts
    225
    Post Thanks / Like
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Inserting value from cell in another cell within quotes

    I don't have the Bloomberg Addin but to insert double quotes in a string you can wrap double quotes in double quotes so something like this in B2
    Code:
     =""""&A2&" CUSIP "&",CNTRY_OF_DOMICILE"""
    will give cell B2 results of
    "99934U0F2 CUSIP ,CNTRY_OF_DOMICILE"
    Life advice found on a book of matches: "Keep cool. Keep away from children."

  3. #3
    New Member
    Join Date
    Sep 2019
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Inserting value from cell in another cell within quotes

    Thank you so much for your help! I'm trying to get a result of "99934U0F2 CUSIP" ,"CNTRY_OF_DOMICILE", but adding those two extra quotations marks is proving to be tricky.

  4. #4
    Board Regular Toadstool's Avatar
    Join Date
    Mar 2018
    Posts
    225
    Post Thanks / Like
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Inserting value from cell in another cell within quotes

    This should do it if A2 has 99934U0F2

    Code:
    =""""&A2&" CUSIP"""&" ,""CNTRY_OF_DOMICILE"""
    Life advice found on a book of matches: "Keep cool. Keep away from children."

  5. #5
    New Member
    Join Date
    Sep 2019
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Inserting value from cell in another cell within quotes

    Thank you, just what I was looking for!

  6. #6
    New Member
    Join Date
    Sep 2019
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Inserting value from cell in another cell within quotes

    I just realized I'm showing up with an extra quote and no comma: "99373U9F3 "CUSIP ""CNTRY_OF_DOMICILE"".

    I don't need a quote before CUSIP, but I do need a comma between CUSIP and CNTRY_OF_DOMICILE, so that I get something like

    =BDP("99934UOF2 CUSIP", "CNTRY_OF_DOMICILE"). Trying to take out commas around CUSIP just leaves me with errors, as well as trying to add a comma in between. Adding commas to the end of the string leaves me with too many.

  7. #7
    Board Regular Toadstool's Avatar
    Join Date
    Mar 2018
    Posts
    225
    Post Thanks / Like
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Inserting value from cell in another cell within quotes

    Maybe take out the space before the comma?

    A B
    2 99934U0F2 "99934U0F2 CUSIP","CNTRY_OF_DOMICILE"
    Sheet3

    Worksheet Formulas
    Cell Formula
    B2 =""""&A2&" CUSIP"""&",""CNTRY_OF_DOMICILE"""
    Life advice found on a book of matches: "Keep cool. Keep away from children."

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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