I am looking for some help with IFs function

Powerpukl

New Member
Joined
Jun 17, 2022
Messages
6
I am looking for some help as have been hitting my head against a wall all morning!

I am trying to find a formula to pull out if someone is male or female or other. sex code (1 = Female, 2 = Male, 3 = Other) from BD11100005 this digit

If the bolded is (1 = Female, 2 = Male, 3 = Other).I know I need to use the IFs function,

=IFS(MRN=1,"F",2,"M",3,"O"), but do I need to include MID, left or right to specify the position of the bolded number?

Any help much appreciated I need this done by ending of tomorrow.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi Powerpukl,

Here's one way - I'm sure there's others:

=CHOOSE(MID(A2,3,1),"Female","Male","Other")

Assumes the code is in cell A2 (bolded). Change to suit.

Regards,

Robert
 
Upvote 0
Hi Powerpukl,

Here's one way - I'm sure there's others:

=CHOOSE(MID(A2,3,1),"Female","Male","Other")

Assumes the code is in cell A2 (bolded). Change to suit.

Regards,

Robert
Thank you so much :)! is there a way to do it using the IF function too
 
Upvote 0
I'm using Excel 2013 atm which doesn't have the IFS function but looking here try this:

=IFS(VALUE(MID(A2,3,1))=1,"Female",VALUE(MID(A2,3,1))=2,"Male",VALUE(MID(A2,3,1))=3,"Other")
 
Upvote 0
FWIW I would recommend keeping away from the IFS function & use nested IF functions (or in this case Choose) as they are far more efficient then IFS.
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,186
Members
448,554
Latest member
Gleisner2

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top