+ Reply to Thread
Results 1 to 18 of 18

Using data from a column with a particular heading

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Using data from a column with a particular heading

    SEE SPREADSHEET IN COMMENTS BELOW, NOT THIS ONE
    Hi all, I am looking for some help with the spreadsheet below:

    In the Data Analysis tab in, for example, cell B17 I have set it to search for all "pupil premium" pupils who are performing "below" where they should. The problem is that for each different group of pupils sometimes the headings on our school system are swapped (so for example the heading "Pupil Premium Indicator" may not always fall in the D column). Is there any way of getting Excel to search for that heading and only use data from that column?

    I am trying to do the same for the headings "SEN Status" and "Gender" as well but if you are able to help me out with a formula for the above, I should hopefully be able to work it out.

    Many thanks in advance
    Last edited by codyryan; 03-18-2014 at 07:50 AM. Reason: uploaded incorrect spreadsheet

  2. #2
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Using data from a column with a particular heading

    Blank analysisHELP1.xlsx

    sorry this is the correct spreadsheet ^^

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: Using data from a column with a particular heading

    Will the column's heading be exactly the same, regardless of its position in the sheet?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Using data from a column with a particular heading

    That's correct

  5. #5
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Using data from a column with a particular heading

    Hi
    =SUMPRODUCT((INDEX(Info!$A$2:$AO$39,0,MATCH("Pupil Premium Indicator",Info!$A$1:$AO$1,0))="Y")*(Info!$AH$2:$AH$39="Below"))

    For others( gender and etc) you can type or modify formula or if its written in any cell you can reference it.
    Appreciate the help? CLICK *

  6. #6
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Using data from a column with a particular heading

    That's great thank you very much! I am trying to do the same for cells b22, b23 and b24 but the problem is that the indicator for SEN pupils can be either "S", "A" or "P" rather than just being "S" for example. How do I formulate it so that it can recognize all of these letters?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: Using data from a column with a particular heading

    =SUMPRODUCT((INDEX(Info!$A$2:$AO$39,0,MATCH("SEN Status",Info!$A$1:$AO$1,0))=OR("S","A","P"))*(Info!$AH$2:$AH$39="Below"))

    Instead of ="Y", use =OR("S","A","P")

  8. #8
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Using data from a column with a particular heading

    Here is my solution. Paste to B22 and drga down
    =SUMPRODUCT(IF(ISERROR(SEARCH(INDEX(Info!$A$2:$AO$39,0,MATCH("SEN Status",Info!$A$1:$AO$1,0)),"SAP")),0,1)*(Info!$AH$2:$AH$39=$A17))

  9. #9
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Using data from a column with a particular heading

    Formula above will give you wrong result:
    =SUMPRODUCT((INDEX(Info!$A$2:$AO$39,0,MATCH("SEN Status",Info!$A$1:$AO$1,0))={"S","A","P"})
    *(Info!$AH$2:$AH$39=A22))
    Below = 0
    Expected = 2
    Above = 3

    But in total there is six "SAP" letters. In column AH one of the cells left blank that is why this formula in total gives 5 (2+3)

  10. #10
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Using data from a column with a particular heading

    Hey thanks again for that. I just tried pasting a new set of data and the formulae don't seem to be working now? Any idea what i'm doing wrong?

    Here's what it looks like with the new data:
    Blank AnalysisHELP2.xlsx

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: Using data from a column with a particular heading

    You need to apply the INDEX and MATCH functions to the second half of the formula. In the new sheet, the range is the AG column, not AH.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: Using data from a column with a particular heading

    Try this in B17:

    =SUMPRODUCT((INDEX(Info!$A$2:$AO$39,0,MATCH("Pupil Premium Indicator",Info!$1:$1,0))="Y")*((INDEX(Info!$A$2:$AO$39,0,MATCH("KS2-3 Progress4 Y7 Spring 2",Info!$1:$1,0))="Below")))

  13. #13
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Using data from a column with a particular heading

    Sorry for the late response, been working! Thanks I'll give it a try now and let you know how I get on

  14. #14
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Using data from a column with a particular heading

    OK the formula you gave worked great, but now i'm struggling with cells: B12, B13 and B14 and also cells B3,4,5,7,8 as I don't know how the index formula really works.

    Sorry to ask so much of everyone!
    Blank AnalysisHELP3.xlsx

  15. #15
    Registered User
    Join Date
    12-10-2013
    Location
    Manchester, UK
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Using data from a column with a particular heading

    Can anyone help?

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: Using data from a column with a particular heading

    Tomorrow, maybe, if nobody else has stepped in.

  17. #17
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Using data from a column with a particular heading

    Formula has given there. Only thing you should do is to change "Pupil Premium Indicator" to the required column name. In B12:B14 cells right relevant column name (ex Progress).

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: Using data from a column with a particular heading

    In B12:

    =COUNTIF((INDEX(Info!$A$2:$AO$39,0,MATCH("KS2-3 Progress4 Y7 Spring 2",Info!$1:$1,0))),"Below")

    In B3:

    =COUNTIF((INDEX(Info!$A$2:$AO$39,0,MATCH("Gender",Info!$1:$1,0))),"M")

    In B7:

    =COUNTIF((INDEX(Info!$A$2:$AO$39,0,MATCH("Pupil Premium Indicator",Info!$1:$1,0))),"Y")

    In B8:

    =COUNTIF((INDEX(Info!$A$2:$AO$39,0,MATCH("SEN Status",Info!$1:$1,0))),"S")+COUNTIF((INDEX(Info!$A$2:$AO$39,0,MATCH("SEN Status",Info!$1:$1,0))),"A")+COUNTIF((INDEX(Info!$A$2:$AO$39,0,MATCH("SEN Status",Info!$1:$1,0))),"P")

    How INDEX and MATCH work (and I have only recently worked this out myself by following threads like this on these boards):

    MATCH: find a cell in row one on the Info sheet containing "Gender" (for example)
    INDEX: carry out the calculation required on cells in the range A2 to A39 that are found below the cell found by MATCH

    I hope this helps!
    Last edited by AliGW; 03-19-2014 at 02:35 AM.

+ 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. Replies: 4
    Last Post: 10-31-2011, 04:33 PM
  2. Put Column Data in Page Heading
    By doddski in forum Excel General
    Replies: 2
    Last Post: 12-19-2006, 05:21 AM
  3. [SOLVED] In a table produce an value by column heading and row heading
    By naflan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-27-2005, 01:25 PM
  4. [SOLVED] How do I put a Heading on each column of data?
    By new with excel in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-09-2005, 03:06 PM
  5. [SOLVED] Selecting data from column heading
    By VBA Novice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2005, 10:06 AM

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