Modify Uptime formula in Excel VBA 2010

DoodlesMama

New Member
Joined
Aug 26, 2012
Messages
14

Excel 2010
Windows 7
Hello,
I'm at a beginner level in creating Excel formulas and using them in VBA and need to change the formula below to reflect a blank cell if there is no data to calculate rather than reflecting a 100%.



[SAT_UPTIME_METRICS1] = _
"=1-(SUMIFS(EFFT_RESOLVE_HRS2,EFFT_WEEKDAY2,7,EXCEPTION2,""<>YES"")/SATURDAY_HRS)"
[SAT_UPTIME_METRICS1] = [SAT_UPTIME_METRICS1].Value




[UPTIME_METRICS1] = _
"=1-(SUMIFS(EFFT_RESOLVE_HRS2,STATE2,STATES1_1,EFFT_WEEKDAY2,""<>7"",DEVICE2,UPTIME_DEV1,EXCEPTION2,""<>YES"")/WEEKDAY_HRS)"
[UPTIME_METRICS1] = [UPTIME_METRICS1].Value


See tables below for what it looks like currently and what I want it to look like.

BEFORE
SLA = 99%
SEVERITY =ALL
DEVICE =TAB
SATURDAY56.67%<---SATURDAY FORMULA
TOTAL100%<---NEED TO CREATE
AR100%<---REG FORMULA
AZ100%
CA100%
CT100%
DC100%
DE100%
FL100%
GA100%
IA100%
KS100%

<TBODY> [TD="align: center"]UPTIME %[/TD]
[TD="align: center"][/TD]

</TBODY>
AFTER
SLA = 99%
SEVERITY =ALL
DEVICE =TAB
SATURDAY56.67%<---SATURDAY FORMULA
TOTAL100%<---NEED TO CREATE
AR100%<---REG FORMULA
AZ
CA
CT100%
DC
DE100%
FL
GA100%
IA
KS100%

<TBODY> [TD="align: center"]UPTIME %[/TD]
[TD="align: center"][/TD]

</TBODY>
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
The easiest way that I see without knowing what that formula is doing and not wanting to guess, is to create an if for the 0 condition that I assume is causing 100% (1-nothing = 100%), so I'm hazarding a guess at the following working:


[SAT_UPTIME_METRICS1] = _
"=if(SUMIFS(EFFT_RESOLVE_HRS2,EFFT_WEEKDAY2,7,EXCEPTION2,""<>YES"")/SATURDAY_HRS)
=0,"",1-(SUMIFS(EFFT_RESOLVE_HRS2,EFFT_WEEKDAY2,7,EXCEPTION2,""<>YES"")/SATURDAY_HRS))"

[SAT_UPTIME_METRICS1] = [SAT_UPTIME_METRICS1].Value

and the second:

[UPTIME_METRICS1] = _
"=if(SUMIFS(EFFT_RESOLVE_HRS2,STATE2,STATES1_1,EFFT_WEEKDAY2,""<>7"",DEVICE2,UPTIME_DEV1,EXCEPTION2,""<>YES"")/WEEKDAY_HRS)
=0,"",1-(SUMIFS(EFFT_RESOLVE_HRS2,STATE2,STATES1_1,EFFT_WEEKDAY2,""<>7"",DEVICE2,UPTIME_DEV1,EXCEPTION2,""<>YES"")/WEEKDAY_HRS))"

[UPTIME_METRICS1] = [UPTIME_METRICS1].Value
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,372
Members
448,888
Latest member
Arle8907

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