Nested IF statements/single formula needed conditional on three separate values - HELP! :)

ljdmitchell

New Member
Joined
Feb 25, 2015
Messages
5
I've tried to look at every example of multiple/nested IF statements to see if I could figure this out - as I know it's staring me right in the face. :eek: I've tried AND, OR - and just can't get it to work. Here's the basic issue - simply trying to find out the average number of days that a loan takes to close - based on whether it's a specific bank or not, and then filter out two other possible fields to narrow it down further - taking out one or the other, the loan type and loan reason. I've created a mock example below - can you please help?

1. Need formula for the average # of days to close IF BANK NOT EQUAL to South Bank....and excluding TYPE=Secondary.
2. Need formula for the average # of days to close IF BANK NOT EQUAL to South Bank...and exclude IF TYPE=Secondary and/or IF REASON=GREEN.
3. Need any false values to either be N/a or "-".
4. F Column would be value/formula for #1 example above.
5. G Column would be value/formula for #2 example above.

I've tried nested IF statements, with DAYS360 to calculate...with this for #1 above.
=IF(A2<>"South Bank",IF(C2<>"Secondary",DAYS360(F8,H8),"-"))

<tbody>
</tbody>


Then I've tried this for #2 above.
=IF(A2<>"South Bank",IF(C2<>"Secondary",IF(B2<>"Green",DAYS360(F8,H8),"-")))

<tbody>
</tbody>

Here's the example - hope this makes sense...and thanks in advance for any help...apologies if it's really simple too. :)
BANK
REASON
TYPE
Start Date
Finish Date
ABC Bank
Green
Primary
1/1/2015
1/28/2015
123 Bank
Yellow
Primary
1/5/2015
1/8/2015
Victory Bank
Green
Secondary
12/15/2014
12/31/2014
South Bank
Green
Secondary
1/19/2015
2/20/2015
First National Bank
Blue
Primary
12/1/2014
2/12/2015
South Bank
Brown
Primary
12/19/2014
1/4/2015
South Bank
Red
Secondary
1/1/2015
2/1/2015
Garden Bank
Green
Primary
2/1/2015
2/2/2015

<tbody>
</tbody>
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi ljdmitchell, i'm not shure if this is what you want, even if it is i'm also shure that someone arround here has a much elegant way of doing it but this is what i came up with:

<title>Excel Jeanie HTML</title>


<!-- ######### Start Erzeugter Html Code zum Kopieren ########## -->


Sheet1

ABCDEFGHI
1BANKREASONTYPEStart DateFinish Date CRITERIA
2ABC BankGreenPrimary01-01-201528-01-201527 South Bank
3123 BankYellowPrimary05-01-201508-01-20153 Secondary
4Victory BankGreenSecondary15-12-201431-12-2015381 Green
5South BankGreenSecondary19-01-201520-02-201532
6First National BankBluePrimary01-12-201412-02-201573
7South BankBrownPrimary19-12-201404-01-201516 26
8South BankRedSecondary01-01-201501-02-201531 38
9Garden BankGreenPrimary01-02-201502-02-20151

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:125px;"><col style="width:65px;"><col style="width:71px;"><col style="width:75px;"><col style="width:76px;"><col style="width:65px;"><col style="width:65px;"><col style="width:73px;"><col style="width:73px;"></colgroup><tbody>
</tbody>

Formulas
CellFormula
I7=SUMPRODUCT(--(A2:A9<>H2),--(C2:C9<>H3),E2:E9-D2:D9)/COUNTIFS(A2:A9,"<>"&H2,C2:C9,"<>"&H3)
I8=SUMPRODUCT(--(A2:A9<>H2),--(C2:C9<>H3),--(B2:B9<>H4),E2:E9-D2:D9)/COUNTIFS(A2:A9,"<>"&H2,C2:C9,"<>"&H3,B2:B9,"<>"&H4)

<tbody>
</tbody>

<tbody>
</tbody>


Excel Tabellen im Web darstellen >> Excel Jeanie HTML 4.8






<!-- ######### Ende Erzeugter Html Code zum Kopieren ########## -->
 
Upvote 0
Thanks SteveO59L and Caribeiro77 for the responses....much appreciated. On the AVERAGEIFS - yes, but I need it by row for each line....which I didn't explain very well. Same thing Caribeiro77 - that's the result I want, however I want each row to have the value, if it meets the criteria. I've edited my example to show the two additional columns of data I'm looking for, where I need the formulas by row to give me the value, if applicable and it meets the critera...or come back with a N/A....so the total average doesn't get skewed. I entered "numbers" in the two new columns to show the result of what the formula would come back with...just need help figuring out what formula will calculate the number of days, based on if it doesn't equal a specific bank - and then if it meets one or both of the other two conditions - not green and not primary.

See if this new edited example makes more sense. Definitely appreciate your input!

BANKREASONTYPEStart DateFinish Date# Days To Close (ALL)# Days To Close (ONLY South Bank - Excluding Secondary)# Days To Close (NOT South Bank - Excluding Green OR Secondary)
ABC BankGreenPrimary1/1/20151/28/201527N/AN/A
123 BankYellowPrimary1/5/20151/8/20153N/A3
Victory BankGreenSecondary12/15/201412/31/201416N/AN/A
South BankGreenSecondary1/19/20152/20/201531N/AN/A
First National BankBluePrimary12/1/20142/12/201571N/A71
South BankBrownPrimary12/19/20141/4/20151515N/A
South BankRedSecondary1/1/20152/1/201530N/AN/A
Garden BankGreenPrimary2/1/20152/2/20151N/AN/A
TOTAL AVERAGE24.251537
* # Days to Close (ALL) in Column Q uses formula: DAYS360(O2,P2)
* Need to know formula for R2:R9 to come up with those values, for each row.
* Need to know formula for S2:S9 to come up with those values, for each row.
* Nested IF statement but using DAYS360 for formula, if true.

<colgroup><col style="width: 82pt; mso-width-source: userset; mso-width-alt: 3986;" width="109"> <col style="width: 64pt; mso-width-source: userset; mso-width-alt: 3108;" width="85"> <col style="width: 48pt;" width="64"> <col style="width: 55pt; mso-width-source: userset; mso-width-alt: 2669;" span="2" width="73"> <col style="width: 48pt;" width="64"> <col style="width: 64pt; mso-width-source: userset; mso-width-alt: 3108;" width="85"> <col style="width: 53pt; mso-width-source: userset; mso-width-alt: 2560;" width="70"> <tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,054
Latest member
juliecooper255

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