Writing Multiple If functions

aackerm

New Member
Joined
Feb 3, 2015
Messages
2
I think I need to do this in VBA but I have no idea. Here's what I need; to compare numbers in two different cells based on multiple arguments. For example, if the number in A1 is <20 and the number in B1 is >=60 then C1 Shows "Pass", if A1 = 21 and B1 is >= 61 then C1 shows "Pass". I need to extend this argument all the way to if A1 = 100. Any assistance would greatly be appreciated.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
=if(A1<20,"pass",if(A1>=60,"pass",if(A1=21,"pass",if(B1>=61,"pass","failed"))))

hope this helps
 
Upvote 0
Perhaps

Code:
If 60 + WorksheetFunction.Max(0, (Range("A1").Value - 20)) <= Range("B1") Then
    MsgBox "pass"
Else
    MsgBox "fail"
End If
 
Upvote 0
I should add that the scale changes once the number in A1 reaches 62. Example: if A1 =62 and B1 <= 81 then C1 shows "Pass", if A1=63 and B1<=82 the C1 shows "Pass", if A1 =64 and B1 <=82 then C1 shows "Pass"... if A1 = 95 and B1 <= 98 then C1 shows "Pass".
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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