+ Reply to Thread
Results 1 to 18 of 18

Is this possible - type of Vlookup dynamic range

  1. #1
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Is this possible - type of Vlookup dynamic range

    Hi,

    I am trying to find a way to automate the pulling of data from multiple ranges into one sheet from two different files. I have attached an example and will try to explain it and was wondering if this is even possible.

    In the example the 3 BB report tabs represent different outputs from Bloomberg in a standard report. The starting cell is always the same, but the number of positions in the portfolio varies. Also, when I rebalance the portfolios the same portfolio can increase or decrease in the number of holdings (portfolio one could have 8 next time)

    The portfolio tab represents the current holdings in each portfolio.

    The consolidated tab represents a report I am trying to generate by automatically pulling in data.

    The issue that I am having is that multiple portfolios have the same security, but in a different weight % of the portfolio.

    Is it possible to create a vlookup (or some other function/nested function) to search for the portfolio name and create a range from that? I can't highlight a whole column and do a dynamic range that way because the generated reports from Bloomberg have merged cells that interfere with doing a vlookup.

    if this doesn't make sense and you need for clarifiing or explained different let me know.

    Thank you for the help.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    bottera,

    Welcome to the forum. If I understand you correctly (and I'm not convinced I do!) you're having trouble populating the "Original Weight" column in the "Consolidated" tab - is this correct? Forgive me, as I'm unfamiliar with some of the terms & logic behind what you're doing - I just need to know what you want, and where you want it
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    If I am on the right track, have a look at Column K in the "Consolidated" tab, and see if/how that might work for you.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    i am able to populate the original weight and the current weight from the bb report tab (and the generated report from bloomberg as well).

    I am trying/wondering if there is a way to dynamically have excel/vlookup specifiy a range. I am attaching an updated example. imagine two period in time where the first example was done. next i make changes to the data and in the (2) tabs is the new updated data. is there a way for the consolidated tab to run through the data and update changes like that (including increasing the range to look through based on the portfolio name, ie portfolio 1 now has 6 pieces of data instead of 4)

    i would like to be able to have it pull out data that matches the portfolio name from the portfolio tab as well based on how many positions/items are listed. is it possible to have it pull the data associated in the portfolio name and ticker (for each portfolio) and separate the data?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    it seems like it is on the right track. I was trying to change portfolio names and it works but not completely. in cell i2 if I change the portfolio 1 to portfolio 2 it automatically changes the original weight (this is great), but if I change it to portfolio 3 i get an error N/A. how could I fix this.

    i will have to learn more about index and matching it seems.

    does what I am trying to do make sense at all or is it confusing?
    Last edited by bottera; 11-26-2012 at 03:58 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    Quote Originally Posted by bottera View Post
    I was trying to change portfolio names and it works but not completely. in cell i2 if I change the portfolio 1 to portfolio 2 it automatically changes the original weight (this is great), but if I change it to portfolio 3 i get an error N/A. how could I fix this.
    You can fix this easily by correcting the typing error you have in your "Portfolio" tab - you have PorTfolio 3 entered as "Porfolio 3" - you're missing the "T".

  7. #7
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    sorry about the dumb mistake lol...got that to work, but the same issue is happening in say call i6.

    I can change the portfolio 2 in i6 to portfolio 3 and it will grab the value, but if I change it to portfolio 1 I receive an error

  8. #8
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    Whoops, looks like you're not the only one making mistakes Put this:

    Please Login or Register  to view this content.
    in K2 (committed with Ctrl, Shift & Enter at the same time). I didn't make the cell references absolute initially, so when the formula was copied down through Column K, the cell references were changing, when of course they shouldn't, as we want to look in the same place for each search. Sorry about that!

  9. #9
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    works perfect...I will have to adjust everything to match, but this seems like it will work great. If I have any other issues I will let you know.

    you mentioned ctrl+shift+enter and I notice {} around the formula...what does this do by chance? I see how it makes a difference, but don't know what/how this does.

    edit: googled it and it seems you can array an excel formula...no idea this could be done...i have a lot to learn still it seems

    any guides that describe all these things and other useful things?
    Last edited by bottera; 11-26-2012 at 04:59 PM.

  10. #10
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    The formula I gave you is an array formula, and it requires those curly braces {} to work properly. See Google/MSOffice Help/countless online articles for a far better explanation of the ins & outs than I could ever manage

    Glad to hear you're on the right track. How does that leave you fixed for the other column you want to populate (current weight)?

  11. #11
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    those numbers are coming from auto generated reports from bloomberg and all start in cell c14. the thing is some portfolios there are 10 positions/tickers and in some there are 20+. I am trying to find a way to have it count how many there are and input the data based on that. the number will tie out to number of positions in the portfolio tab.

    if you look at the 2nd example i posted it shows a bit of what I mean. the (2) sheets are at a different time (two positions were added). I was wondering if its possible to have it auto populate and work back to what we (actually you ) just accomplished

  12. #12
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    bottera, is there some (any?) reason to keep the original data when you have new data from a different point in time?

  13. #13
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    (It would be a lot more straightforward if you didn't need to keep the "old" data, and just overwrote existing data, hence my question.)

  14. #14
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    no I do not need to keep the old data and would prefer not to . I gave that example just to show two periods in time and what types of changes would occur.


    the next part I am wondering is if it is possible to have the array function loop through the data to check for an increase or decrease in positions/tickers and consolidate/grab the list.

    in the 2nd example I posted if you notice portfolio 1 had two tickers added. now I didn't set those cells = to the respective part on bb report 1, but that is how I currently have it. Is there a way to say count the number of positions and create a vlookup/array function/etc and print the tickers?
    Last edited by bottera; 11-27-2012 at 11:03 AM.

  15. #15
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    I noticed a small issue with the array...it isn't grabbing the correct value for some reason. I have attached an example from my actual worksheet which might be more clear.

    even though the portfolio name matches in cell a1 and in the reference area, it is not grabbing the correct value. when the name of the portfolio is say value1 it returns N/A, but when the name of the portfolio is value2 it returns the value which should have been input when the name was value1.

    there are notes on sheet1 which can show the issue happening.

    edit: it seems to be because they are the last entries to that portfolio name..is this common or am i just missing something small?
    Attached Files Attached Files
    Last edited by bottera; 11-27-2012 at 04:25 PM.

  16. #16
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    Quote Originally Posted by bottera View Post
    no I do not need to keep the old data and would prefer not to
    So why not just paste the new data over the old data? Simples

    Also, formula is not working in your latest spreadsheet because you're using incorrect cell references. You need:

    Please Login or Register  to view this content.
    The data on Sheet2 starts in Row 1, so you need to use Row 1 references - you were referencing Sheet2!$A$2 and Sheet2!$C$2 in your formula.

    I'll have a little look at your 2nd request later, should be do-able.

  17. #17
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Is this possible - type of Vlookup dynamic range

    Quote Originally Posted by bottera View Post
    the next part I am wondering is if it is possible to have the array function loop through the data to check for an increase or decrease in positions/tickers and consolidate/grab the list.
    Why not have a 2nd sheet for data - one called "beginning weight" and one called "current weight" (or whatever.) Column D on your sheet1 can look at the tab "beginning weight" and return the % as it does now. Column E can look to the "current weight" tab in the same way, and Column F can then show the difference between the 2, allowing you to highlight increases/decreases.

    If you get NEW data, copy the "current weight" data into the "beginning weight" tab, copy the NEW data into the "current wight" tab, and..... you get the picture. That might not be as elegant a solution as you're hoping for, but it's a solution that you currently have the know-how to put in place.


    Quote Originally Posted by bottera View Post
    in the 2nd example I posted if you notice portfolio 1 had two tickers added. now I didn't set those cells = to the respective part on bb report 1, but that is how I currently have it. Is there a way to say count the number of positions and create a vlookup/array function/etc and print the tickers?
    I actually haven't a clue what you're asking for here - sorry.

  18. #18
    Registered User
    Join Date
    11-26-2012
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Is this possible - type of Vlookup dynamic range

    very sorry for the delay in responding...i wasnt receiving email notifications in regards to this thread so I wasn't sure if you responded again.

    good catch on starting in a2 rather than a1, its always small things that mess everything up

    I was trying to automate it as much as possible as every two weeks I generate reports from Bloomberg (market data service) and just save over the current files (that is why I said I do not need the old data)

    when you say you don't know what I am talking about let me see if I can explain it better (it has to do with the auto generated reports I just mentioned)

    the data in the reports that I need all start in a specific cell (c14), the issue is the number of positions in each portfolio (from the generated reports) varies. ie for say portfolio 1 it will have 15 positions/tickers and go down to cell c29, but portfolio 2 has 10 positions so it would go to cell c24. I can't highlight the whole column as there is an automatically generated disclaimer 3 cells (these cells are blank) below the last position that is a merged cell (can't get rid of it except manually, unless there is something I don't know ). The amount of positions/tickers in each portfolio can range to as much as 10.

    so I was wondering if there was a way to say count from c14 down to cx till there is an empty cell, based on that number add it to c14 to generate the range to look for the array...does this make more sense?

+ 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