# Happy Holidays male or female

#### sanch0156

##### New Member
Hello Everyone,

I created this sheet for the organization which I volunteer unfortunately I am
stuck! For those less fortunate families so we can provide them with gifts.

I would like it to detect automatically gender whether it be male of female.

Here are the codes I have so far:

MALE =IF(C121<6,"",IF(C121>=11,"",IF(C121>=6,"M",)))
FEMALE =IF(\$C124<=5,"F","")

### Excel Facts

Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

#### SSPoulin23

##### New Member
im assuming you mean automatically, based on their input into a cell. but what would you like it to do once it detects the gender?

#### sanch0156

##### New Member
To place an M or an F in a given column.

I can send a Jpeg, but I'm not sure if this form allows it

Thank you for the quote response

#### SSPoulin23

##### New Member
=IF(C121="Male","M",IF(C121="Female","F","?"))

if they're typing their own option into C121, you may end up with choices other than male or female due to spelling errors or what have you. I would probably add a data validation to it, using a list hidden either on a different tab or somewhere on the sheet of Male or Female so they have to choose one or the other.

The "?" will fill in if they type some thing other than male or female. if you want it blank, just leave it as ""

hope that accomplishes what you're looking for!

#### mikerickson

##### MrExcel MVP
Another option might be =UPPER(LEFT(C121, 1))

#### sanch0156

##### New Member
I apologize for not making this clear. I need it to work with the formula below. There are four columns age groups: 0 through 5, 6 through 10, 11 through 15 and 16 through 17. I need it to recognize example: row B2 Column B4 "M" for Male or F for Female in the corresponding cell.

=IF(B2<6,"",IF(B2>=11,"",IF(B2>=6,"M",)))

 Child's Name Age Gender 0-5 6-10 11 -15 16 - 17 John Jane

<tbody>
</tbody>

#### mikerickson

##### MrExcel MVP
How would it know that "John" is male?

What gender is "Francis" or "Robin"?

#### Macropod

##### Retired Moderator
Presumably Age & Gender are specified in columns B & C, respectively. In that case, for columns D:G you could use a formula like:
=IF(MAX(INT((\$B2-1)/5),0)-(COLUMN()-4)=0,\$C2,"")

#### sanch0156

##### New Member
 Child's Name Age Gender 0-5 6-10 11 -15 John 12 Male M Jane 5 Female 5

<tbody>
</tbody>

Thank you for responding appropriately "Macropod" really stressed trying to do this for approximately 65 unfortunate children.

To your question B&C are separate.

I was using this formula. Which only detects age. Let's use John for example I would put the formula below in F2 and as you can tell by the formula it would put an M at the end after it met all the criteria.

John =IF(B2<11,"",IF(B2>=16,"",IF(B2<=16,"M",))) This formula was placed in F2.

I would like to add a TEXT "F' or "M" in a cell for both age and gender.

#### sanch0156

##### New Member
I apologize meant to put an "F" in D2

Replies
5
Views
2K
Replies
9
Views
314
Replies
3
Views
559
Replies
9
Views
607
Replies
3
Views
584

1,190,883
Messages
5,983,387
Members
439,841
Latest member
goodwillhunting

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back