Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Average formula multiple worksheets

Alright... This has been stumping me for awhile and I dont know if there is
an easy way to do this, but I'm hoping someone smarter than me could help. I
have a workbook that contains 13 worksheets ("Average" and "Jan" thru "Dec").
My "Average" worksheet needs to find the values of a specific employee
(vlookup) for every month and then average their data... Now I wrote a
formula that accomplishes that; however sometimes an employee may not have
any data for a specific month or they may have an "N/a" because that month
didnt count for them. When that happens my formula comes back as either
"#N/A" or "#DIV/0". I'm looking for a formula that will simply exclude these
months from the average formula. Here is what I am using currently. Please
help if you know how to do this! Thanks!

=AVERAGE(IF(ISNA(VLOOKUP(B7,Jan,4,0)),{""},VLOOKUP (B7,Feb,4,0)),IF(ISNA(VLOOKUP(B7,Mar,4,0)),{""},VL OOKUP(B7,April,4,0)),IF(ISNA(VLOOKUP(B7,May,4,0)), {""},VLOOKUP(B7,June,4,0)),IF(ISNA(VLOOKUP(B7,July ,4,0)),{""},VLOOKUP(B7,Aug,4,0)),IF(ISNA(VLOOKUP(B 7,Sept,4,0)),{""},IF(ISNA(VLOOKUP(B7,Oct,4,0)),{"" },IF(ISNA(VLOOKUP(B7,Nov,4,0)),{""},IF(ISNA(VLOOKU P(B7,Dec,4,0)),{""},"N/a")))))


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Average formula multiple worksheets

J,

The general kernel could be this --
IF(NOT(ISNA(VLOOKUP(B7,Feb,4,0))),VLOOKUP(B7,Feb,4 ,0)) -- times twelve:

=AVERAGE(IF(NOT(ISNA(VLOOKUP(B7,Jan,4,0))),VLOOKUP (B7,Jan,4,0)),IF(NOT(ISNA(VLOOKUP(B7,Feb,4,0))),VL OOKUP(B7,Feb,4,0)),
10 more times)



But that is terrible design. So, why not create a table?

In B7, and down the column, put the employee, and in C6 and across, put Jan,
Feb, etc.

Then in C7, put the formula

=IF(NOT(ISERROR(VLOOKUP($B7,INDIRECT(C$6),4,0))),V LOOKUP($B7,INDIRECT(C$6),4,0))

and copy to match your values in column B and in row 6. Then average those
twelve formulas.

HTH,
Bernie
MS Excel MVP




"JAbels001" wrote in message
...
Alright... This has been stumping me for awhile and I dont know if there
is
an easy way to do this, but I'm hoping someone smarter than me could help.
I
have a workbook that contains 13 worksheets ("Average" and "Jan" thru
"Dec").
My "Average" worksheet needs to find the values of a specific employee
(vlookup) for every month and then average their data... Now I wrote a
formula that accomplishes that; however sometimes an employee may not have
any data for a specific month or they may have an "N/a" because that month
didnt count for them. When that happens my formula comes back as either
"#N/A" or "#DIV/0". I'm looking for a formula that will simply exclude
these
months from the average formula. Here is what I am using currently. Please
help if you know how to do this! Thanks!

=AVERAGE(IF(ISNA(VLOOKUP(B7,Jan,4,0)),{""},VLOOKUP (B7,Feb,4,0)),IF(ISNA(VLOOKUP(B7,Mar,4,0)),{""},VL OOKUP(B7,April,4,0)),IF(ISNA(VLOOKUP(B7,May,4,0)), {""},VLOOKUP(B7,June,4,0)),IF(ISNA(VLOOKUP(B7,July ,4,0)),{""},VLOOKUP(B7,Aug,4,0)),IF(ISNA(VLOOKUP(B 7,Sept,4,0)),{""},IF(ISNA(VLOOKUP(B7,Oct,4,0)),{"" },IF(ISNA(VLOOKUP(B7,Nov,4,0)),{""},IF(ISNA(VLOOKU P(B7,Dec,4,0)),{""},"N/a")))))




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average Cells in Multiple Worksheets Karen Excel Worksheet Functions 10 March 19th 08 03:22 PM
Calculate Average Accross Multiple Worksheets JK Excel Discussion (Misc queries) 1 May 3rd 07 05:34 PM
1 cell average across multiple worksheets curtll Excel Worksheet Functions 8 May 11th 06 01:35 PM
=Average(if( formula using different worksheets aka_krakur Excel Worksheet Functions 3 February 1st 06 12:16 AM
Average Values / Multiple Worksheets George Reis Excel Worksheet Functions 5 January 31st 06 10:27 PM


All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"