+ Reply to Thread
Results 1 to 8 of 8

Autofill help accessing random cells on separate sheet reference

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    5

    Autofill help accessing random cells on separate sheet reference

    I'm looking to take a exported database that outputs in the format

    A5 Customer Number
    B5 Name
    A6 Address1
    A7 Address2
    H6 Home #
    H7 Work #
    L6 First Date
    L7 Last Date
    H8 E-Mail
    L8 Birthday

    and repeats
    A9 Customer Number
    ...

    I want to reformat this on Sheet2
    A1 Customer Number
    B1 Name
    C1 Address1
    D1 Address2
    E1 Home#
    F1 Work#
    G1 Email
    H1 Birthday
    I1 First Date
    J1 Last Date

    and repeat
    A2 Customer Number

    Since the formatting is all over the place I haven't been able to figure out a formula on Sheet 2 that will allow me to autofill and grab the customer information.
    I've tried INDIRECT and INDEX with no luck.
    I'm sure this has to be possible

    Thanks
    Attached Files Attached Files
    Last edited by nemish; 05-23-2011 at 10:37 AM. Reason: add example workbook

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,323

    Re: Autofill help accessing random cells on separate sheet reference

    Please post a sample workbook so that we don't have to create a structure and invent test data before trying to offer a solution.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Autofill help accessing random cells on separate sheet reference

    Quote Originally Posted by TMShucks View Post
    Please post a sample workbook so that we don't have to create a structure and invent test data before trying to offer a solution.

    Regards
    Attached to OP

    Thanks

  4. #4
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Autofill help accessing random cells on separate sheet reference

    ok got some help...

    data is now coming over to next sheet ... just need to know how to stop making empty cells reference as 0's on the resulting sheet

    =OFFSET(Sheet1!$A$2,((ROW()-1)*4)+CHOOSE(COLUMN(),0,0,1,2,0,1,3,3,0,1),CHOOSE(COLUMN(),0,1,0,0,7,7,7,11,11,11))

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,323

    Re: Autofill help accessing random cells on separate sheet reference

    Try:

    =OFFSET(Sheet1!$A$2,((ROW()-1)*4)+CHOOSE(COLUMN(),0,0,1,2,0,1,3,3,0,1),CHOOSE(COLUMN(),0,1,0,0,7,7,7,11,11,11)) &""

    Note the ampersand double quote double quote at the end

    Regards

  6. #6
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Autofill help accessing random cells on separate sheet reference

    Quote Originally Posted by TMShucks View Post
    Try:

    =OFFSET(Sheet1!$A$2,((ROW()-1)*4)+CHOOSE(COLUMN(),0,0,1,2,0,1,3,3,0,1),CHOOSE(COLUMN(),0,1,0,0,7,7,7,11,11,11)) &""

    Note the ampersand double quote double quote at the end

    Regards
    I'm actually doing it without the ampersand at the end... what's the purpose of this?

    Also because of blank cells my formula is this currently:


    =IF(ISBLANK(OFFSET(Sheet1!$A$2,((ROW()-1)*4)+CHOOSE(COLUMN(),0,0,1,2,0,1,3,3,0,1),CHOOSE(COLUMN(),0,1,0,0,7,7,7,11,11,11))),"",OFFSET(Sheet1!$A$2,((ROW()-1)*4)+CHOOSE(COLUMN(),0,0,1,2,0,1,3,3,0,1),CHOOSE(COLUMN(),0,1,0,0,7,7,7,11,11,11)))

  7. #7
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Autofill help accessing random cells on separate sheet reference

    Quote Originally Posted by nemish View Post
    I'm actually doing it without the ampersand at the end... what's the purpose of this?

    Also because of blank cells my formula is this currently:


    =IF(ISBLANK(OFFSET(Sheet1!$A$2,((ROW()-1)*4)+CHOOSE(COLUMN(),0,0,1,2,0,1,3,3,0,1),CHOOSE(COLUMN(),0,1,0,0,7,7,7,11,11,11))),"",OFFSET(Sheet1!$A$2,((ROW()-1)*4)+CHOOSE(COLUMN(),0,0,1,2,0,1,3,3,0,1),CHOOSE(COLUMN(),0,1,0,0,7,7,7,11,11,11)))
    I tried your , &"" and found it left justifies the data in the cells. Problem is last 3 columns are dates and on the resulting sheet I cannot change the formatting to Date now.

    Is there something else it does that I missed? or reasoning it should be used?

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,323

    Re: Autofill help accessing random cells on separate sheet reference

    Yes, I realised that. What it is doing is converting the values to text. Hence the issue with the dates in the last three columns. You could use that approach for the non-date values; that at least would be tidier.

    Or you could get Excel to not display zero values. Or you could use Conditional Formatting.

    Regards

+ 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