Formula to skip value if sheet is missing

cornepiek

New Member
Joined
Jun 22, 2010
Messages
48
Hi all.

i need some assistance with a funny one.
i need two formulas, 1 to calculate average, and another to calculate the sum of the same field over multiple sheets.
ie: =Datasheet!B1+Datasheet(2)!B1+Datasheet(3)!B1

However, the data sheets i work with do not always contain the same amount of sheets.

so if i only had 2 sheets in this case, and used the same formula, the resulting formula would end up as
=Sheet1!B1+Sheet2!B1+REF
since sheet 3 does not exist.
also, if i had 4 sheets, then only the first 3 sheets will be included in the formulas.

the sheet names will always start with the same word ("Datasheet" in this case) with the sheets numbered in multipled as above.


i need this formula in a VBA macro in order to simplify my agents work.

Please help

thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,196,487
Messages
6,015,479
Members
441,898
Latest member
kofafa

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