ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Urgent Help (https://www.excelbanter.com/excel-programming/410030-urgent-help.html)

kiran

Urgent Help
 
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

Greg Wilson

Urgent Help
 
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


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com