# Help with IF function

#### rmaclagan

##### New Member
I need cell V3 to populate with a percentage that corresponds with a range of cells (AC7:AF9 shown below) based on a couple of variables (their age, whether they are male or female). basically it should be like this...

Cell V3 (A Soldiers Allowed BF%) will automatically populate from a range (AC7:AF9) based on cell E3 (whether they are M (Male) of F (Female)) and their age (which auto populates based on their date of birth) in cell F3. But if cell D3 (date of birth) is blank then it returns blank.

The Range looks like this:

AGE GROUP 17-20 21-27 28-39 40+
MALE BF% 20% 22% 24% 26%
FEMALE BF% 30% 32% 34% 36%

Hopefully this is enough info. If not let me know and i will get it for you as soon as i can.

### Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

#### Weazel

##### Well-known Member
You could try something like

Code:
``=IF(D3="","",CHOOSE(IF(E3="M",1,2),LOOKUP(F3,{17,21,28,40},{0.2,0.22,0.24,0.26}),LOOKUP(F3,{17,21,28,40},{0.3,0.32,0.34,0.36})))``

you'd have to format V3 as a percentage

#### rmaclagan

##### New Member
You could try something like

Code:
``=IF(D3="","",CHOOSE(IF(E3="M",1,2),LOOKUP(F3,{17,21,28,40},{0.2,0.22,0.24,0.26}),LOOKUP(F3,{17,21,28,40},{0.3,0.32,0.34,0.36})))``

you'd have to format V3 as a percentage

Thanks Weazel. Thats what i needed it to do.

Replies
5
Views
516
Replies
3
Views
154
Replies
3
Views
141
Replies
3
Views
401
Replies
0
Views
151

1,141,059
Messages
5,704,034
Members
421,323
Latest member
Exidous

### 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