+ Reply to Thread
Results 1 to 10 of 10

Column title based on criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47

    Column title based on criteria

    Hello again,

    I would like to title columns based on values from other cells...
    A	B	C	D	E	F	G	H	I
    1	123	12	15	80%	1
    2	124	22	39	56%	
    3	125	22	35	63%	
    4	234	12	15	80%	1
    5	235	17	28	61%	
    6	236	6	11	55%	
    7	345	17	23	74%	1
    8	346	21	33	64%	
    9	347	21	32	66%
    Where "1" (Column F) identifies the rows that meet the criteria (>=70%)
    So...Column G (Cell G1) would be 123, H (Cell H1) would be 234, I (Cell I1) would be 345.

    I know the identifier is probably not necessary, but I thought it'd be easier, but I didn't figure it out even with it.
    I had a column assigned to each number, but my document ended up having like 100 columns! It would be best to only use columns for rows that meet the criteria.

    Thanks!
    Last edited by oldchippy; 11-03-2008 at 07:02 AM. Reason: Additional question

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Try this in column F instead of column G and do it in one go

    =IF(E1>=70%,B1,"")
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47
    Quote Originally Posted by oldchippy View Post
    Hi,

    Try this in column F instead of column G and do it in one go

    =IF(E1>=70%,B1,"")
    Thanks for the suggestion, but that still requires me to have separate columns for each row. I wanted consecutive columns to only contain what meets the criteria.
    I don't know if there's a way to have the Cell G1 find the first "1" in column F, then Cell H1 find the second "1" in column F and so on...that would be the only way I can imagine doing it.

    I guess this would count as finding the nth occurrence of a value or string. I used a vlookup function to return the first value, but can't figure out how to get it return second value.

    I've googled "nth value excel" and there's some information out there, but in the examples I see, their problem is solved by creating a new column and adding a number association to the strings to differentiate them. Is there any other way?
    Last edited by asdvender; 10-19-2008 at 11:26 AM.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Try this, if you put this formula in F1 and copy down

    =IF(E1>=70%,ROW(),"")

    then this in G1 copied across to the right

    =IF(ISERROR(VLOOKUP(SMALL($F:$F,COLUMN()-6),$A$1:$B$9,2,FALSE)),"",VLOOKUP(SMALL($F:$F,COLUMN()-6),$A$1:$B$9,2,FALSE))

  5. #5
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47
    Quote Originally Posted by oldchippy View Post
    =IF(E1>=70%,ROW(),"")
    =IF(ISERROR(VLOOKUP(SMALL($F:$F,COLUMN()-6),$A$1:$B$9,2,FALSE)),"",VLOOKUP(SMALL($F:$F,COLUMN()-6),$A$1:$B$9,2,FALSE))
    Awesome! Thanks a ton, oldchippy!
    Last edited by asdvender; 10-19-2008 at 06:58 PM.

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi asdvendar,

    Got your message about column A, you could just select column A at the top, right click > Hide if you don't need it in view

  7. #7
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47
    I had this working fine, but as I moved things around, I figured out some way to screw it up!

    The cells I am referencing are M256:S563, I want to display the values of the second column where the criteria of column R<>"" in cells AL1:BT1.

    I know it's hard to follow, so I am attaching my Excel sheet without the guts.

    I was pretty sure I was doing it right, I played around with the example and got it to work in different scenarios, but I can't get it to work when it matters...

    Thanks in advance.
    Attached Files Attached Files
    Last edited by asdvender; 11-01-2008 at 10:37 PM.

  8. #8
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47
    I managed to get it to work...somewhat...

    =IF(ISERROR(VLOOKUP(SMALL($S:$S,COLUMN()-37),$M$256:$N$563,2,FALSE)),"",VLOOKUP(SMALL($S:$S,COLUMN()-37),$M$256:$N$563,2,FALSE))
    However, sometimes it gives me blanks leading up to the number I want, then I have to adjust the COLUMN() correction factor.
    Other times it repeats a number (like now it is repeating 47 in the Excel sheet).
    And it even gives me values I don't want...

    Any ideas?
    Last edited by asdvender; 11-01-2008 at 10:38 PM.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    try this array formula confirmed with ctrl shift and enter (so the { } brackets appear around it )in cell AL1 and then drag across row

    =IF(COLUMN()-37>COUNTIF($R$256:$R$2000,"W"),"",INDEX($N$256:$N$2000,SMALL(IF($R$256:$R$2000="W",ROW($R$256:$R$2000)-255,""),COLUMN()-37)))

  10. #10
    Registered User
    Join Date
    04-18-2008
    Location
    Chicago, IL
    Posts
    47
    Quote Originally Posted by martindwilson View Post
    try this array formula confirmed with ctrl shift and enter (so the { } brackets appear around it )in cell AL1 and then drag across row

    =IF(COLUMN()-37>COUNTIF($R$256:$R$2000,"W"),"",INDEX($N$256:$N$2000,SMALL(IF($R$256:$R$2000="W",ROW($R$256:$R$2000)-255,""),COLUMN()-37)))
    PERFECT!
    Thanks Martin!

+ 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. Highlight based on two criteria
    By daland1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2008, 05:09 AM
  2. Finding Avg. Based on Criteria Found in a Second Column
    By Alhazred in forum Excel General
    Replies: 5
    Last Post: 02-07-2008, 04:17 PM
  3. Replies: 1
    Last Post: 01-17-2007, 11:50 PM
  4. counting text in a column w/text criteria to other column
    By LnghairdFreak in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-20-2006, 04:37 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