Help Rearranging If Statement

nirvehex

Active Member
Joined
Jul 27, 2011
Messages
498
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to rearrange my if statement and I'm getting lost in it...

Here's the code broken apart:

Code:
=IF(OR(F6="Y",AN6<=6),AQ6,


IF(AND(O6="N",SEARCH("Comp",D6),LEFT(D6,2)+0>24,AQ6>=7.5),AQ6,


IF(AND(O6="N",SEARCH("Comp",D6),LEFT(D6,2)+0>24),


IF(OR(AND(VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)))>Details!AR6)),7.5,


IF(AND(O6="N",SEARCH("Comp",D6),LEFT(D6,2)+0>24,VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)<5,VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)<5,VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)<5,VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)<5,VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)<5,(365/((AN6*AQ6)/VLOOKUP(CONCAT(D6,"-",O6),Calibration!P:S,4,FALSE)))>AR6),5,IF(AND(VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)>=5,VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)<7.5,ROUNDDOWN(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)),0)>ROUNDDOWN(AR6,0)),VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE),IF(AND(VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)>=5,VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)<7.5,ROUNDDOWN(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)),0)>ROUNDDOWN(AR6,0)),VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE),IF(AND(VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)>=5,VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)<7.5,ROUNDDOWN(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)),0)>ROUNDDOWN(AR6,0)),VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE),IF(AND(VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)>=5,VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)<7.5,ROUNDDOWN(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)),0)>ROUNDDOWN(AR6,0)),VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE),IF(AND(VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)>=5,VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)<7.5,ROUNDDOWN(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)),0)>ROUNDDOWN(AR6,0)),VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)))))))))))

I'm trying to push this part to the end, so it get's evaluated last. Can someone help me rearrange and reconstruct please? I feel like I'm going nuts looking at it...

Code:
IF(OR(AND(VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:B,2,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:C,3,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:D,4,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:E,5,FALSE)))>Details!AR6),AND(VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)>=7.5,(365/((AN6*AQ6)/VLOOKUP(A6,'WOs (DSP Only)'!A:F,6,FALSE)))>Details!AR6)),7.5,

Thank you all!
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,213,513
Messages
6,114,072
Members
448,546
Latest member
KH Consulting

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