+ Reply to Thread
Results 1 to 14 of 14

Segregating Boys from Girls

  1. #1
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Segregating Boys from Girls

    Hello guys!


    I need help on this workbook I'm working on.

    In this file I uploaded for reference, I need to copy the names from Student Data (sheet) to Sheet 1. However, the students in the Student Data Sheet were not segregated between the boys and the girls and I wanted to segregate it on Sheet 1. Is there a formula in doing so? If not, what is the VBA code that would achieve this?

    I'm really not familiar with VBA codes, and I would really appreciate it if you would help.. Thanks a lot!

    Information Sheet.xls
    Last edited by wedzmer; 07-10-2014 at 09:27 AM.

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Segregating Boys from Girls

    Find the attached file
    Attached Files Attached Files
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Segregating Boys from Girls

    Hi nflsales!!!

    Thanks a lot!

    Quick question before I mark the thread solved... Would the same formula you used in Sheet 1 work if the Students Data Sheet varies in number of Boys and Girls..?For example if the boys had 40 students and the girls had 18, so the range of the cells would adjust in Students Data Sheet.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Segregating Boys from Girls

    Please Login or Register  to view this content.
    Change the Ranges 'Student Data'!$C$7:$C$41 & 'Student Data'!$G$7:$G$41 according to your needs like
    if your data has 200 Rows then change the formula like
    =IF(ISERROR(INDEX('Student Data'!$C$7:$C$2000,LARGE(INDEX(('Student Data'!$G$7:$G$2000="M")*ROW(INDIRECT("1:"&ROWS('Student Data'!$G$7:$G$2000))),0),COUNTIF('Student Data'!$G$7:$G$2000,"M")-ROWS(B$12:B12)+1))),"",INDEX('Student Data'!$C$7:$C$2000,LARGE(INDEX(('Student Data'!$G$7:$G$2000="M")*ROW(INDIRECT("1:"&ROWS('Student Data'!$G$7:$G$2000))),0),COUNTIF('Student Data'!$G$7:$G$2000,"M")-ROWS(B$12:B12)+1)))
    for Boys and
    =IF(ISERROR(INDEX('Student Data'!$C$7:$C$2000,LARGE(INDEX(('Student Data'!$G$7:$G$2000="F")*ROW(INDIRECT("1:"&ROWS('Student Data'!$G$7:$G$2000))),0),COUNTIF('Student Data'!$G$7:$G$2000,"F")-ROWS(B$43:B43)+1))),"",INDEX('Student Data'!$C$7:$C$2000,LARGE(INDEX(('Student Data'!$G$7:$G$2000="F")*ROW(INDIRECT("1:"&ROWS('Student Data'!$G$7:$G$2000))),0),COUNTIF('Student Data'!$G$7:$G$2000,"F")-ROWS(B$43:B43)+1))) for girls
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-23-2014
    Location
    Dubbo, Australia
    MS-Off Ver
    EXCEL 2019
    Posts
    180

    Re: Segregating Boys from Girls

    and, as a rule, name the relevant column Gender, not ***
    Pete
    Struggling Solutions Architect

  6. #6
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Segregating Boys from Girls

    Change the Ranges 'Student Data'!$C$7:$C$41 & 'Student Data'!$G$7:$G$41 according to your needs like
    Would dragging the arrow work? I'm afraid that would give me error...

    and I noticed you placed a formula on cell B8:

    Please Login or Register  to view this content.
    Would something if I deleted this?


    And Hello DubCap01,

    What do you mean by
    and, as a rule, name the relevant column Gender, not ***
    ?

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Segregating Boys from Girls

    If you deleted some rows also It will work.

  8. #8
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Segregating Boys from Girls

    Quote Originally Posted by nflsales View Post
    If you deleted some rows also It will work.
    I see...
    But the formula won't work when combined...
    I mean, i tried to manipulate the formula to make a new Student Information Sheet referencing from the old one... But it won't work...

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Segregating Boys from Girls

    upload the file for which it is not working

  10. #10
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Segregating Boys from Girls

    I tried to make a replica of the Student Data Sheet on Sheet2.... I wanted to reference the same thing using the said formula but this time, combining the Male and Female.

    here's the formula I tried to manipulate with:

    Please Login or Register  to view this content.
    Here's the new file I wanted to use it.. but gives me error...

    Information Sheet_1.xls

  11. #11
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Segregating Boys from Girls

    see the attached file
    Attached Files Attached Files

  12. #12
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Segregating Boys from Girls

    Sir nflsales, i don't really get the difference between the 3 formulas.. are they really the same? I mean, if I was to make the other columns, what's the difference between the formulas?
    Last edited by wedzmer; 07-10-2014 at 08:14 AM.

  13. #13
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Segregating Boys from Girls

    Copy the formula and change the Column Number
    for example
    =IF(ISERROR(INDEX('Student Data'!$A$7:$AN$200,LARGE(INDEX(('Student Data'!$G$7:$G$200=IF(ROWS(C$4:C4)>COUNTIF('Student Data'!$G$7:$G$200,"M"),"F","M"))*ROW(INDIRECT("1:"&ROWS('Student Data'!$G$7:$G$200))),0),COUNTIF('Student Data'!$G$7:$G$200,IF(ROWS(C$4:C4)>COUNTIF('Student Data'!$G$7:$G$200,"M"),"F","M"))-ROWS(G$4:G4)+1+IF(ROWS(C$4:C4)>COUNTIF('Student Data'!$G$7:$G$200,"M"),COUNTIF('Student Data'!$G$7:$G$200,"M"),0)),7)),"",INDEX('Student Data'!$A$7:$AN$200,LARGE(INDEX(('Student Data'!$G$7:$G$200=IF(ROWS(C$4:C4)>COUNTIF('Student Data'!$G$7:$G$200,"M"),"F","M"))*ROW(INDIRECT("1:"&ROWS('Student Data'!$G$7:$G$200))),0),COUNTIF('Student Data'!$G$7:$G$200,IF(ROWS(C$4:C4)>COUNTIF('Student Data'!$G$7:$G$200,"M"),"F","M"))-ROWS(G$4:G4)+1+IF(ROWS(C$4:C4)>COUNTIF('Student Data'!$G$7:$G$200,"M"),COUNTIF('Student Data'!$G$7:$G$200,"M"),0)),7))
    Gender in 7th Columns thats why i have enter 7 for Birth Date change it as 8.

  14. #14
    Forum Contributor wedzmer's Avatar
    Join Date
    06-13-2014
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    422

    Re: Segregating Boys from Girls

    hahaha! So that's the difference!
    Thanks nflsales!!!

+ 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. Finding and Segregating Outliers
    By StatsFan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-22-2012, 02:37 PM
  2. Boys versus Girls
    By gelandl in forum The Water Cooler
    Replies: 9
    Last Post: 03-24-2009, 06:10 AM
  3. Segregating Hyperlink & HyperText - Please Help
    By ramki in forum Excel General
    Replies: 2
    Last Post: 03-13-2009, 08:31 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