+ Reply to Thread
Results 1 to 16 of 16

extracting and printing cells under a condition from a large data

  1. #1
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    extracting and printing cells under a condition from a large data

    Hello,
    I have a data table on excel. It is attached. (Book1) Pa and Pb are my probability values and I want to extract the highest value for the combination of each Pa and Pb. The highest values are under I column, namely Best. I have a table on the right and for example, at the left up corner I want excel to print the Best value where where Pb=0.01 and Pa=0, and so on. What is the easy way to do it?
    Also, each P max value has a reference code on the right. (J column). It tells me what P value (P1,P2,P3,P4) gives the highest value in that combination. I want to color each Best value according to its reference. For example, Red for P1, green for 2, orange for P3, blue for P4.
    Any help is appreciated. Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: extracting and printing cells under a condition from a large data

    Quote Originally Posted by yellowcanary View Post
    Hello,

    I have a data table on excel. It is attached. (Book1) Pa and Pb are my probability values and I want to extract the highest value for the combination of each Pa and Pb. The highest values are under I column, namely Best. I have a table on the right and for example, at the left up corner I want excel to print the Best value where where Pb=0.01 and Pa=0, and so on. What is the easy way to do it?
    To make certain I understand the first question: Start with copy and paste this array-entered formula in cell N6. Fill down and across to BA45.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Array formulas are not committed in the regular way. You commit by pressing and holding Ctrl + Shift as you hit Enter. You will know that it has been entered successfully when you can see curly braces {} around your formula in the formula bar. You do not type these in yourself. Excel does it for you.

    Does this give expected results for the first question?
    Last edited by FlameRetired; 05-12-2015 at 12:07 AM. Reason: clarity / rephrase

  3. #3
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    Re: extracting and printing cells under a condition from a large data

    Hello. Thank you for the reply. I did it but I can only see blank cells after pressing ctrl+shift+enter. The formulas are in the cells though.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: extracting and printing cells under a condition from a large data

    The blank cells suggest that the steps might be out of order. In cell N6 ...... from edit mode ........ press and hold Ctrl + Shift as you hit Enter. Then fill down and across to BA45. Is that how you did it?

  5. #5
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    Re: extracting and printing cells under a condition from a large data

    Yes, I did it now. It works. Thank you so much. As you can see now, I have triangle. Since I assume Pa<Pb, just ignore the -3.6 after Pb=0.01 and Pa=0.
    I have to do numeric analysis with a large data and it will help me a lot. Now, I want to distinguish the P1,P2,P3,P4. Is there a way to put a color to each cell depending on their value. Now, I have only P1 and P2 in this table, but when I change the probabilities P3 and P4 will be included. I want to show each cell with different colors, so I can see the trend for each P. I attached the excel file again.
    Attached Files Attached Files
    Last edited by yellowcanary; 05-13-2015 at 04:35 PM.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: extracting and printing cells under a condition from a large data

    The attached has conditional formats applied to Table1.

  7. #7
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    Re: extracting and printing cells under a condition from a large data

    Thank you. Is there a way move these colors to the table? I need to see where the color changes from one probability to another. Also, in this example I have only 2 colors but sometimes I need to show all P's in 4 colors. So, using the table to see it would be more convenient.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: extracting and printing cells under a condition from a large data

    Quote Originally Posted by yellowcanary View Post
    Thank you. Is there a way move these colors to the table? I need to see where the color changes from one probability to another. Also, in this example I have only 2 colors but sometimes I need to show all P's in 4 colors. So, using the table to see it would be more convenient.
    When you say table are you referring now to cells N6:BA45?


    Edit If that is what you are referring to I cannot think of a way to do that formula-wise without your workbook taking an enormous performance hit. VBA might be an alternative, but I know very little VBA. I can call for help on this one if you like. Please let us know.
    Last edited by FlameRetired; 05-14-2015 at 09:53 PM.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: extracting and printing cells under a condition from a large data

    Double posted.

  10. #10
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    Re: extracting and printing cells under a condition from a large data

    Yes, by table I mean N6:BA45. So, whenever I copy and paste a new numbers, the table shows the highest number among P1 to P4, and the colors make it easy to differentiate which P beats others. I appreciate if you call for help.

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: extracting and printing cells under a condition from a large data

    I've called for help.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: extracting and printing cells under a condition from a large data

    Not having followed this thread much, please test this and see if it is giving the same results.

    1. I added a helper column in K, (which can be hidden), and used this in K2 (the Table copied it down)...
    =Table1[[#This Row],[Pa]]&" "&Table1[[#This Row],[Pb]]

    2. I adjusted FT's ARRAY formula from
    =IFERROR(INDEX($I$2:$I$821,MATCH(MAX(($B$2:$B$821=N$5)*($A$2:$A$821=$M6)),($B$2:$B$821=N$5)*($A$2:$A$821=$M6),0)),"")

    to this regular formula
    =IFERROR(INDEX($I$2:$I$821,MATCH(N$5&" "&$M6,$K$2:$K$821,0)),"")

    As far as the colors are concerned, can you provide a few samples of what you want?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  13. #13
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    Re: extracting and printing cells under a condition from a large data

    Hello. Thank you so much for the help. Now, in my table there are 4 cases P1,P2,P3,P4. Pa and Pb are probabilities, you can ignore the other columns. I want to assign a color for each P and when I check the table I want to be able to see the highest P number at the intersection of each Pa and Pb, and the color for each case (P1,P2,P3,P4). For example, I assign P1= 'green', P2=Red, P3='yellow', P4= 'blue' and when Pb= 0.15 and Pa=0.02, P2's value is the higgest, so it will appear in the box on the table and its color red will be the color of that cell.
    So, when I look at the table I can see the color alteration in each region for each pa and pb values

  14. #14
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    Re: extracting and printing cells under a condition from a large data

    Maybe, it is my mistake but the formula you sent gives me blank cells.

  15. #15
    Registered User
    Join Date
    04-21-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    17

    Re: extracting and printing cells under a condition from a large data

    Any idea about it? Should I do it on VBA?

  16. #16
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: extracting and printing cells under a condition from a large data

    Are these the blank cells you refer to?

+ 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. extracting and printing cells under a condition
    By yellowcanary in forum Excel General
    Replies: 3
    Last Post: 05-12-2015, 10:50 AM
  2. extracting and printing cells under certain criteria in excel
    By yellowcanary in forum Excel General
    Replies: 1
    Last Post: 04-24-2015, 05:55 PM
  3. Extracting data from large spreadsheet
    By FryGlo in forum Excel General
    Replies: 26
    Last Post: 02-08-2014, 11:34 PM
  4. Extracting data from a large sheet
    By SERENETZM in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-08-2013, 03:25 AM
  5. Printing large cells
    By scrapbear in forum Excel General
    Replies: 0
    Last Post: 01-05-2006, 03:20 PM

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