+ Reply to Thread
Results 1 to 13 of 13

Search column & list all occurances of value offset from string

  1. #1
    Registered User
    Join Date
    09-12-2008
    Location
    Alaska
    Posts
    9

    Search column & list all occurances of value offset from string

    I need to make a list of items that occur above the string "Room" and the data offset to the bottom and bottom right.

    Here is the sample data:
    1, 100A
    2, Room, Rh
    3, 123, 11
    3, 200B
    4, Room, Rh
    5, 456, 24
    6, 300C
    7, Room, Rh
    8, 789, 56
    ...

    On another sheet this is what the output should look like:
    1 100A 123 11
    2 200B 456 24
    3 300C 789 56
    ...

    Here is a copied function that I've been trying to work with. "ROOM_AREAS" is the range in column A. I just can't seem to figure out how the ROW and SMALL functions are supposed to work here.
    Please Login or Register  to view this content.
    What this gives me is:
    100A
    200B
    300C
    ...

    I'm stuck. Please help!
    Last edited by robystar; 04-16-2009 at 12:58 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search column & list all occurances of value offset from string

    asuming data starts in a1 try in D1 =OFFSET($A$1,ROW()*3-3,0); in E1 =OFFSET($A$1,ROW()*3-1,0);inF1 =OFFSET($A$1,ROW()*3-1,1)
    dragged down
    Last edited by martindwilson; 04-10-2009 at 05:52 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    09-12-2008
    Location
    Alaska
    Posts
    9

    Re: Search column & list all occurances of value offset from string

    Thanks for the response martindwilson. But, I think I overcomplicated my problem. Here is a better illustration:

    1a
    Room, 123
    xxxxx,
    1b
    Room, 456
    xxxxx,
    xxxxx,
    1c
    Room, 678
    xxxxx,

    I want to find each occurrence of "Room" and return the value next to it and above it and skip all the garbage data represented by "xxxxx".

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search column & list all occurances of value offset from string

    ok there are a few ways to do this one wayuse formulas as on attached sheet and drag down
    then autofilter either column c or d on non blanks
    select the complete rows copy paste to another sheet
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-12-2008
    Location
    Alaska
    Posts
    9

    Re: Search column & list all occurances of value offset from string

    Excellent, Thanks!
    I think I can work with a macro to make the filter do what I want, but there is one minor annoyance left. I've attached a dumbed down version of what I'm working on. The "Summary" sheet is where I have the problem (Sorry, a little screwed up after removing some macros). As you can see on the "HeatLoss" sheet at the "200-Room" grouping there can be more than one line of data. I overcame this issue by putting the data used for the summary in columns Q, R, S & T. My problem is the user can't easily copy/paste the data groupings in this configuration. I'm trying to find a way to get rid of the Q,R,S and T columns on the "HeatLoss" sheet. Any ideas of suggestions?
    Attached Files Attached Files
    Last edited by robystar; 04-13-2009 at 08:43 PM.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search column & list all occurances of value offset from string

    cant see any q,r,s,t columns.
    another thing you should avoid is all those merged cells!
    if you say put
    Floor/Roof Loss [Btu/hr]
    all in c3 then select c and d format/ cells/ alignment/horizontal choose centre across selection from the dropdown instead
    and for cells above and below each other put a bit in each cell and just remove the gridline between them (or just put in one cell and let it be bigger.)
    but it might be an idea to post an original with before and after perhaps a vba solution would be better

  7. #7
    Registered User
    Join Date
    09-12-2008
    Location
    Alaska
    Posts
    9

    Re: Search column & list all occurances of value offset from string

    Thanks! The un-merging of the cells was a great idea.
    I've updated the formatting per your suggestions.
    This latest attachment is fully functional for the most part.
    I did have the previous version working with VB but the constant user problems with macro security is what prompted me to redo the sheet without macros.

    If you check HeatLoss!R35 you'll see that this "hidden" value corresponds with Summary!B5. I would like to get rid of the "hidden" stuff on the HeatLoss sheet so the user can easily copy/paste the groupings. Any ideas?

    By the way. I can't thank you enough for your help so far.
    Attached Files Attached Files
    Last edited by robystar; 04-14-2009 at 06:13 PM.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search column & list all occurances of value offset from string

    i think i may be losing something in the conversion to my version!
    ther is no r35 on heatloss a row 35 yes a cell r35 no
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-12-2008
    Location
    Alaska
    Posts
    9

    Re: Search column & list all occurances of value offset from string

    I've uploaded your 97 version with the "unhidden" cells.
    Sorry, one of the macros was set to restrict the print area on open.
    Try this.
    Attached Files Attached Files

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search column & list all occurances of value offset from string

    still cant quite get what you mean? i thought you were copying from summary sheet?
    what exactly is the range you want to copy and what bits shouldnt be in it?
    give me an example of the finished paste on a spare sheet how it is now and what youd like it to look like.

  11. #11
    Registered User
    Join Date
    09-12-2008
    Location
    Alaska
    Posts
    9

    Re: Search column & list all occurances of value offset from string

    Sure,

    CAL1 is what happens if the user doesn't select the Q,R,S,T cells on the heatloss sheet for the appropriate rows when copy/pasting. Note "400-ROOM" missing from the summary sheet. I want the user to not have to the select the Q,R,S,T columns when copy/pasting the groupings. Example: 300-ROOM has the same specs as 600-ROOM, so the user would just duplicate 300-ROOM with a copy/paste and change the description to 600-ROOM.

    CAL2 is what I want. The Q,R,S,T columns on heatloss sheet no longer needed.

    Please also note as in the "300-ROOM" grouping on the heatloss sheet that any number of rows can be added to the grouping which makes this a bit complicated.

    Thanks.
    Attached Files Attached Files

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search column & list all occurances of value offset from string

    try hiding q r s t
    then use select visible cells only. 1, add the icon to a tool bar
    right click tool bar/customise/choose edit/scroll down to bodom and youll see the select visible cells icon (looks like 4 boxes in a grid, drag to tool bar
    (now thats in 2003 as you have 2007 youll prob have to do it some wierd and wonderful way involving the ribbon)
    then before copying sheet click that icon and hidden cells are ignored
    ok i found 2007 here
    http://office.microsoft.com/en-us/ex...448971033.aspx

  13. #13
    Registered User
    Join Date
    09-12-2008
    Location
    Alaska
    Posts
    9

    Re: Search column & list all occurances of value offset from string

    Thanks for all your help martindwilson.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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