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 [TABLE="class: grid, width: 250, align: left"]
<TBODY>[TR]
[TD][/TD]
[TD="align: center"]UPTIME %[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]SLA = [/TD]
[TD="align: center"]99%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]SEVERITY =[/TD]
[TD="align: center"]ALL[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]DEVICE =[/TD]
[TD="align: center"]TAB[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]SATURDAY[/TD]
[TD="align: center"]56.67%[/TD]
[TD="align: center"]<---SATURDAY FORMULA[/TD]
[/TR]
[TR]
[TD="align: center"]TOTAL[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"]<---NEED TO CREATE[/TD]
[/TR]
[TR]
[TD="align: center"]AR[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"]<---REG FORMULA[/TD]
[/TR]
[TR]
[TD="align: center"]AZ[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]CA[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]CT[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]DC[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]DE[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]FL[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]GA[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]IA[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]KS[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
</TBODY>[/TABLE]
AFTER
[TABLE="class: grid, width: 250, align: center"]
<TBODY>[TR]
[TD][/TD]
[TD="align: center"]UPTIME %[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]SLA = [/TD]
[TD="align: center"]99%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]SEVERITY =[/TD]
[TD="align: center"]ALL[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]DEVICE =[/TD]
[TD="align: center"]TAB[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]SATURDAY[/TD]
[TD="align: center"]56.67%[/TD]
[TD="align: center"]<---SATURDAY FORMULA[/TD]
[/TR]
[TR]
[TD="align: center"]TOTAL[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"]<---NEED TO CREATE[/TD]
[/TR]
[TR]
[TD="align: center"]AR[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"]<---REG FORMULA[/TD]
[/TR]
[TR]
[TD="align: center"]AZ[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]CA[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]CT[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]DC[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]DE[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]FL[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]GA[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]IA[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]KS[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[/TR]
</TBODY>[/TABLE]
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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