IF(AND statement works - changing to an IF( and IF(OR causes a False - also is there a better way to do this

jgold20

Board Regular
Joined
Feb 4, 2018
Messages
135
Based on an alpha value in A3 and a selection from a drop down in I3 (NO, FULL, PART), I want a numeric value placed in K3. I have this working until I change my IF(AND to an IF(OR and IF(. The first example works and the second one returns a false on the red line when PART is selected (FULL works). The rest of example 2 works. Also is there another way to do this without the IF statements:

=IF(OR($A$3="",$I$3="NO",$J$3=""),"",
IF(AND($A$3="B",$I$3="FULL"),IF($J$3<>0,1.26,),IF(AND($A$3="B",$I$3="PART"),IF($J$3<>0,0.63),
IF(AND($A$3="R",$I$3="FULL"),IF($J$3<500,1.5,IF($J$3<1000,1.25,1)),IF(AND($A$3="R",$I$3="PART"),IF($J$3<500,1.25,IF($J$3<1000,1,0.75)),
IF(AND($A$3="GE",$I$3="FULL"),IF($J$3<500,0.95,IF($J$3<1000,0.85,0.75)),IF(AND($A$3="GE",$I$3="PART"),IF($J$3<500,0.6,IF($J$3<1000,0.55,0.5)),
IF(AND($A$3="NO",$I$3<>"FULL"),"",IF($J$3<600,1.5,IF($J$3<700,1.4,IF($J$3<800,1.3,IF($J$3<1000,1.2,1.15))))))))))))


=IF(OR($A$3="",$I$3="NO",$J$3=""),"",
IF(OR($A$3={"B","W"}),IF($I$3="FULL",IF($J$3<>0,1.26)),IF(OR($A$3={"B","W"}),IF($I$3="PART",IF($J$3<>0,0.63)),
IF(AND($A$3="R",$I$3="FULL"),IF($J$3<500,1.5,IF($J$3<1000,1.25,1)),IF(AND($A$3="R",$I$3="PART"),IF($J$3<500,1.25,IF($J$3<1000,1,0.75)),
IF(AND($A$3="GE",$I$3="FULL"),IF($J$3<500,0.95,IF($J$3<1000,0.85,0.75)),IF(AND($A$3="GE",$I$3="PART"),IF($J$3<500,0.6,IF($J$3<1000,0.55,0.5)),
IF(AND($A$3="NO",$I$3<>"FULL"),"",IF($J$3<600,1.5,IF($J$3<700,1.4,IF($J$3<800,1.3,IF($J$3<1000,1.2,1.15))))))))))))
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Cross posted http://www.vbaexpress.com/forum/showthread.php?63694-Receiving-data-from-a-website-with-Excel-VBA

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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