SaraWitch
Active Member
- Joined
- Sep 29, 2015
- Messages
- 378
- Office Version
- 365
- Platform
- Windows
Hello peeps,
I am trying to return a value based on multiple cells, and my formula is not working:
Any help would be appreciated
I am trying to return a value based on multiple cells, and my formula is not working:
¦ MrExcel Queries.xlsm | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Gender | Pregnant | Adults | Child | Household Code | Should be | ||
2 | Female | No | 1 | 0 | #VALUE! | SF | ||
3 | Male | No | 1 | 0 | #VALUE! | SM | ||
4 | Female | Yes | 1 | 0 | #VALUE! | pregSF | ||
5 | Female | Yes | 2 | 0 | #VALUE! | pregC | ||
6 | Male | No | 1 | 2 | #VALUE! | SM+ | ||
7 | Female | No | 1 | 2 | #VALUE! | SF+ | ||
8 | Female | Yes | 1 | 2 | #VALUE! | SF+ | ||
9 | Male | No | 2 | 0 | 0 | C | ||
10 | Female | No | 2 | 0 | 0 | C | ||
11 | Female | No | 2 | 1 | #VALUE! | F | ||
12 | Male | No | 2 | 2 | #VALUE! | F | ||
Return Multiple Values |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E12 | E2 | =IF(AND(C2=1,A2="Male"),"SM")*IF(AND(C2=1,A2="Female"),"SF")*IF(AND(C2=1,A2="Female",D2>0),"SF+")*IF(AND(C2=1,A2="Male",D2>0),"SM+")*IF(AND(C2>1,D2>0),"F")*IF(AND(C2>1,B2="Yes"),"pregC")*IF(AND(C2=1,B2="Yes"),"pregSF") |
Any help would be appreciated