+ Reply to Thread
Results 1 to 6 of 6

Copy selective data

  1. #1
    Registered User
    Join Date
    07-04-2010
    Location
    prishtina, Kosova
    MS-Off Ver
    Excel 2003
    Posts
    11

    Copy selective data

    I want the information from one workbook, to transfer in other workbook according to the products ordered. For ex. anytime that there is computer, copy the corresponding data such as cost per unit, units ordered,tax etc. in another worksheet. (If this is confusing please see the attachment)
    Attached Files Attached Files
    Last edited by herolindl; 07-20-2010 at 09:15 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: Copy selective data

    Something like this:
    Attached Files Attached Files
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    07-04-2010
    Location
    prishtina, Kosova
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Copy selective data

    Quote Originally Posted by zbor View Post
    Something like this:
    Yes but is there any way to hide when there is #N/A and can you help me to tell what does it mean the formula because I don't understand how it functions and I have to use such formula in some other sheets too and I want to understand how each part functions, please. =INDEX(Sheet1!E$6:E$24, MATCH($B$1 & ROWS($A$1:D6), INDEX(Sheet1!$D$6:$D$24& Sheet1!$A$6:$A$24, 0), 0)). BTW thank you very much.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: Copy selective data

    CHeck this out:

    You can solve it with Pivot Table...

    (and I'll need more time for explanation for formula)
    Attached Files Attached Files

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: Copy selective data

    I have a dept from yesterday...

    So... Main idea is from list of products which can repeat create unique values (adding +1 for each time that value repeats).
    That's why I need helper column A in Sheet1.
    =COUNTIF($D$6:D6;D6)

    This formula will count first a "computer" in range D6:D6 (result =1)
    Then you go down:
    =COUNTIF($D$6:D7;D7)
    This formula will count "scaner" in range D6:D7 (result =1)
    etc.

    Then you'll have computer again:
    =COUNTIF($D$6:D10;D10)
    Where you have 2 computers in range D6:D10 so result is 2.... Next time computer appear it will return 3 etc.

    Joining D and A column you'll get unique list now: computer1, scaner1, printer1, calculator1, computer2, scaner2, computer3 etc...

    This will became a new array (A second INDEX formula) where you'll match your values because if you don't do that when you MATCH computer it will always return first value.

    Now, when you have this additional column we can go further:

    =INDEX(Sheet1!B$6:B$24; MATCH($B$1 & ROWS($B$4:B4); INDEX(Sheet1!$D$6:$D$24& Sheet1!$A$6:$A$24; 0); 0));"")

    If you don't know how INDEX formula work check a help for explanation and here is just a brief:

    INDEX(array,row_num,column_num)

    In our example:
    - array will be column of Consumers
    - row_number will be match of unique values explained above
    - column_num will be 0 (no columns, just rows)

    For return Consumer 2 you have:

    =INDEX(Sheet1!B$6:B$24, 2, 0)

    and number 2 you get when you MATCH "scaner1" in your new array.

    Your new array is INDEX(Sheet1!$D$6:$D$24& Sheet1!$A$6:$A$24; 0)

    (note: If you set row_num or column_num to 0 (zero), INDEX returns the array of values for the entire column or row, respectively.)

    and you want to match $B$1 & ROWS($B$4:B4)

    where B1 is always same value (choose from drop down menu) and ROWS formula will increase by 1 in each row.
    So, if "scaner" is in B1 in combination with & ROWS($B$4:B4) you'll get:
    scaner1, scaner2, scaner3, scaner4, scaner5, scaner6 etc.

    Now you can MATCH each scanerX with unique list (again, explained above)...

    For other columns is same formula, you only change array you want return value from:
    i.e.
    =INDEX(Sheet1!C$6:C$24; MATCH($B$1 & ROWS($B$4:B4); INDEX(Sheet1!$D$6:$D$24& Sheet1!$A$6:$A$24; 0); 0)))

    and everything else is the same.

    Finally, to create empty values you can use:

    =IF(COUNTIF(Sheet1!$D$6:$D$24;$B$1)>=ROWS($B$4:B4); formula; "")

    Countif of scaners is 5.
    So no point of looking below value scaner5. If 6 is reached leave empty.
    Last edited by zbor; 07-07-2010 at 02:23 AM.

  6. #6
    Registered User
    Join Date
    07-04-2010
    Location
    prishtina, Kosova
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Copy selective data

    Thank you very much it helped me a lot.
    Last edited by herolindl; 07-07-2010 at 02:16 PM.

+ 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