Urgent Help

  • Thread starter Thread starter kiran
  • Start date Start date
K

kiran

Hi All,
I want a macro to given formula -

=IF(AND(A2="IncidentLow",B2<=168),"Pass",
IF(AND(A2="IncidentMedium",B2<=24),"Pass",
IF(AND(A2="IncidentHigh",B2<=8),"Pass",
IF(AND(A2="IncidentUrgent",B2<=4),"Pass",
IF(AND(A2="RequestLow",B2<=600),"Pass",
IF(AND(A2="RequestMedium",B2<=120),"Pass",
IF(AND(A2="RequestHigh",B2<=40),"Pass")))))))

Pls help

TIA
 
I don't know why you want a macro to do this. Presumably you just want to
simplify it with a UDF. Suggested simplified array formula follows instead.
For this example, you enter the criteria in cell ranges instead of hard
coding them into the formula. This makes it easier to edit the values and
simplifies the formula.

In cells J1:J7 enter:

IncidentLow
IncidentMedium
IncidentHigh
IncidentUrgent
RequestLow
RequestMedium
RequestHigh

In cells K1:K7 enter:

168
24
8
4
600
120
40

In the desired cell enter the following array formula. Commit with
Ctrl+Shift+Enter instead of just Enter:

=IF(SUM((A2=J1:J7)*(B2<=K1:K7)), "Pass", "Fail")

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top