+ Reply to Thread
Results 1 to 17 of 17

Find value based on 2 comparisons and copy/paste value

  1. #1
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Find value based on 2 comparisons and copy/paste value

    Problem description.
    I am trying to make a funktionality in Excel, where I am going to find a value based om 2 comparisons with 2*2 variables.
    When the value is found, it's going to be copied to cell where the result of the comparison crossed.

    I have made a test sheet, where sheet 1 contains data and value, and sheet 2 contains data and cells for the value.
    Some of the cells are filled manually.
    What I want is, the this filling can be done with eg a macro.

    The code attached, is what I have done so far, but it's no working.
    Any suggestions to solve this problem?

    Kindly regards Peter

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Find value based on 2 comparisons and copy/paste value

    Hi,

    U need the output on 2 condition right and there is no need to work on the 1st tab.

  3. #3
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Find value based on 2 comparisons and copy/paste value

    Hi,

    place this formual on B3 cell of Sheet2

    =INDEX('Sheet 1'!$A:$A,MATCH(1,('Sheet 2'!$A3='Sheet 1'!$C:$C)*('Sheet 2'!B$2='Sheet 1'!$B:$B),0))

    then again press F2 on B3 cells then press Cntrl + shift + enter and drag the formula.

  4. #4
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Find value based on 2 comparisons and copy/paste value

    Hi -

    Use Pivot Table and you can achieve your purpose.

    Regards,
    Event

  5. #5
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Find value based on 2 comparisons and copy/paste value

    Thanks event21 pivot table is more easy to extract data.

    Blichfeldt - please have review the attached workbook and let me know if u hv any question.

    Thanks - Naveed.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    What you send do not update automatic.
    That's important.

    What I'm after, is some generic code that can be activated with a button or automaticly when closing the workbook.

    Regards Peter

  7. #7
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    this line is not working
    =INDEX('Sheet 1'!$A:$A,MATCH(1,('Sheet 2'!$A3='Sheet 1'!$C:$C)*('Sheet 2'!B$2='Sheet 1'!$B:$B),0))

    Regards Peter

  8. #8
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    I like the idea with index, if it works
    Regards Peter

  9. #9
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Find value based on 2 comparisons and copy/paste value

    see if u pasted that index formula in B3 cells then goto B3 cell and press F2 function key and then press at a time Cntl + Shift + enter u will get.

  10. #10
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    I did that, but I couldn't press enter duing to failure in the line at thispoint " $A,MATCH ".
    I don't even get to the point goto B3

  11. #11
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Find value based on 2 comparisons and copy/paste value

    ok,
    1) press F2 in cell B3
    2) then paste the formula and then hold Cntl + Shift and then press Enter u will get its very simple

  12. #12
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    I did that again :-)
    Respone:
    This formula contains invalid entries.

    When I press "OK" it returns with mark around $A,MATCH
    Can this problem be related to language settings

  13. #13
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Find value based on 2 comparisons and copy/paste value

    ok fine i will attach the workbook but see it will make all active worksheet very very very very very slow performance

  14. #14
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    That's fine Raza.

  15. #15
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Find value based on 2 comparisons and copy/paste value

    hv review the attached workbook
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    It was at language problem.
    But this solution is not dueable, it's way to slow.
    I'm proberly back to macro again

  17. #17
    Registered User
    Join Date
    12-03-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Find value based on 2 comparisons and copy/paste value

    It was at language problem.
    But this solution is not dueable, it's way to slow.
    I'm proberly back to macro again

+ 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