+ Reply to Thread
Results 1 to 15 of 15

Populate Cells based on Criteria of Another Cell

  1. #1
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Populate Cells based on Criteria of Another Cell

    Hi there,

    What I'm trying to do is create a formula that multiplies the value of a cell by negative one if the value of another cell is in one of the top three largest value's is its array.

    For example, I want to multiply TRY's value in column L by -1 if it's corresponding rank (in column A) is in the top three of the row.

    The idea is to multiply the numbers is L:V by negative one if it's rank is in the top three of the row.

    Any help is so appreciated!!!



    A B C D E F G H I J K
    Rank
    TRY BRL MXN ZAR KRW INR PLN CLP MYR THB CZK
    7 6 5 4 1 #N/A 3 #N/A #N/A 2 #N/A
    9 8 7 6 1 #N/A 5 4 #N/A 3 2
    8 7 6 5 1 #N/A 4 3 #N/A #N/A 2

    L M N O P Q R S T U V
    TRY BRL MXN ZAR KRW INR PLN CLP MYR THB CZK

    -0.007 -0.002 -0.001 -0.019 -0.005 -0.001 -0.025 0.011 #N/A -0.006 -0.015
    -0.005 -0.020 -0.004 -0.011 -0.005 -0.006 -0.013 -0.008 -0.002 -0.009 -0.012
    0.000 0.002 0.005 0.001 -0.011 -0.001 0.000 0.008 -0.001 -0.005 -0.001
    -0.003 -0.003 -0.007 -0.015 0.001 -0.003 -0.004 0.006 -0.004 -0.011 -0.004
    Attached Files Attached Files
    Last edited by mkeys4; 07-15-2013 at 02:28 PM.

  2. #2
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Populate Cells based on Criteria of Another Cell

    I'd use an IF function, and inside is, use the LARGE function as the basis for your criteria.
    <--- If you like the answer, press *.

  3. #3
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    The formula I currently have is
    =IF(A:4=LARGE($A4:$K4,{1,2,3}),L4*-1,L4)

    But I get #N/A

  4. #4
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    Sorry, ignore the :

    The formula is
    =IF(A4=LARGE($A4:$K4,{1,2,3}),L4*-1,L4)

  5. #5
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Populate Cells based on Criteria of Another Cell

    I don't think LARGE will accept an array as an argument. I'd replace with
    =IF(A4=OR(LARGE($A4:$K4,1),LARGE($A4:$K4,2),LARGE($A4:$K4,3)),L4*-1,L4)

  6. #6
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    Thanks so much for your help zumbalj, but I don't think that's the issue. I've used LARGE with an array before, and tried your version but still got N/A

  7. #7
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Populate Cells based on Criteria of Another Cell

    Can you post a sample spreadsheet? It's really difficult for me to test out a formula and figure out what isn't working without something to test it on.

  8. #8
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    I've attached it to the original post above

  9. #9
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Populate Cells based on Criteria of Another Cell

    The LARGE function doesn't like that there are error values in the array it's evaluating. I'd add something like IF(targetcell="","",targetcell) to the source data so that you only have numbers and blanks to lookup from, no errors to confuse it.

  10. #10
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    Can't believe I didn't see that. Thanks so much!

  11. #11
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Populate Cells based on Criteria of Another Cell

    If that solved your problem, please remember to mark your thread solved.

  12. #12
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    Sorry, this did not solve the problem. For some reason it's only multiplying the number that corresponds to the highest rank by -1. If I copy it across, only one value in the row is multiplied by -1. I want the highest THREE values to be mutiplied.

  13. #13
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    I've attached the new sheet. See "Adjusted Log Change"s
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Populate Cells based on Criteria of Another Cell

    Here's how I solved this:

    I used the iserror and match formula

    =IF(ISERROR(MATCH(A4,LARGE($A4:$K4,{1,2,3}),0))=FALSE,L4*-1,L4)

  15. #15
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Populate Cells based on Criteria of Another Cell

    Nice combination.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Loop through named range backwards and populate based on criteria from adjacent cells
    By CDEG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2013, 05:56 AM
  2. Replies: 8
    Last Post: 10-04-2011, 04:28 PM
  3. Replies: 9
    Last Post: 12-13-2010, 01:42 PM
  4. Populate cells with values based on varying criteria
    By bsweet0us in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2010, 03:56 PM
  5. Populate Cells depending on criteria of other cell
    By thedaddy in forum Excel General
    Replies: 1
    Last Post: 09-05-2009, 12:42 PM

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