+ Reply to Thread
Results 1 to 5 of 5

Can values from UDF on multiple tabs be displayed on another tab? (Excel 2003)

Hybrid View

  1. #1
    Registered User
    Join Date
    01-04-2012
    Location
    Upper Marlboro, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    11

    Thumbs up Can values from UDF on multiple tabs be displayed on another tab? (Excel 2003)

    I have a huge quantity of data coming from a client.
    That means I have no control over the format.
    There are 2 tabs for each day of the week that I am trying to summarize the data on another tab.
    The data requires summing, averaging, min and max calculations. Additionally, the analysis has to ignore cells with no data and bad data (generally "--") which means that I needed to create UDF functions for MIN, MAX. I also had to create one that reads a range and once it locates the maximum in that range, it returns the value from an adjacent cell, using an offset value. I call it MaxAtOffset(rng As Range, offst As Integer)
    On each tab, I can get numbers to generate and can summarize each tabs values.
    But when I try to bring these values together onto another tab to create my overall summary, the values do not show. Occasionally, some display but when I move off of the tab and come back, they all revert to zero.
    I tried making the UDF's in an add-in but that did not help. I added application.volatile to my UDF's but that also did not help.
    I have all recalculate check boxes checked in the options dialog box that I know of. And used Ctrl+Alt+F9.
    Last edited by caddcop; 01-19-2012 at 01:27 PM. Reason: Marking Solved

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Can values from UDF on multiple tabs be displayed on another tab? (Excel 2003)

    Your MaxAtOffset sounds a lot like an INDEX/MATCH() function. You can mix that with MAX().

    =INDEX(Sheet2!$G:$G, MATCH(MAX(Sheet2!$B:$B), Sheet2!$B:$B, 0))

    That formula brings over the value from column G that matches the MAX value in column B on Sheet2.

    Properly written UDFs won't care what sheet they're on, too.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-04-2012
    Location
    Upper Marlboro, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Can values from UDF on multiple tabs be displayed on another tab? (Excel 2003)

    As I mentioned, my data is not clean and cannot be modified. They want to see the empty or invalid characters when they occur. They simply want my analysis to treat those cells as being no data.
    Because of this, I cannot use the MAX function as it throws an error on the invalid characters and the min function must not count zeros as a value. That is why I had to write my own UDF's.
    I had gone through one spread sheet of data and had it consolidating summaries from each sheet onto a separate cover tab.
    But when I moved on to the next spreadsheet, I encountered some of the raw data issues and the errors. That is when I replaced the build in functions with my replacement UDF's. With the UDF's in place, the on sheet summaries functioned properly, although I sometimes had to force the sheet to recalculate. However, that is when I discovered that my off sheet cover tab summaries, that pull data from all of the other sheets were not seeing the data that comes from cells that used the UDF's on the other sheets.
    My UDF's are saved in a module, not a code section of a sheet. I can use them on any sheet. But, when I try to use multi-sheet references to cells from other sheets, and the data on those other sheets is coming from cells that use my UDF's, the formulas return zero values.
    If I could get the built in functions to work and not throw errors, I would not have an issue.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Can values from UDF on multiple tabs be displayed on another tab? (Excel 2003)

    Perhaps you can show us a workbook where we can SEE your UDF in action and point out how it's doing the wrong thing. Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.

  5. #5
    Registered User
    Join Date
    01-04-2012
    Location
    Upper Marlboro, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Can values from UDF on multiple tabs be displayed on another tab? (Excel 2003)

    Here is a subset of the data.
    There are four tabs of data and a summary tab.

    Each tab represents one day of data, in one direction (Northbound or Southbound) and this subset is only weekend data.
    I have 4 weeks of data at 3 locations.

    There are a number of hidden rows and columns. The data is collected in 5 minute intervals and the non-hidden area consolidates that into 15 minute intervals. And then, from that, certain hourly data is being extracted, in addition to min and max numbers within the four fifteen minute intervals that make up the hour.

    I am going to look into trying to use your example
    =INDEX(Sheet2!$G:$G, MATCH(MAX(Sheet2!$B:$B), Sheet2!$B:$B, 0))
    in place of my UDF MaxAtOffset but I do not think I can eliminate my other UDF's.

    I hope you can offer some solution as my only other alternative seems to be to combine all data to a single sheet and then work everything there.

    Note: IMPORTANT FOLLOWUP INFORMATION
    I was able to use the Index, Match and MAX functions and also to use Array Functions to eliminate the need for all of my custom functions.

    The new max function is : =MAX(IF(ISNUMBER(L51:M54),L51:M54)) (with Ctrl+Shift+Enter to make it an array function)
    The new min function is: =MIN(IF(ISNUMBER(L50:M53),IF(L50:M53<>0,L50:M53))) also as an array function.

    Finally, and I do this freely and sheepishly - my summary formulas were pointing at the wrong columns. I forgot that they were copied from a tab that had two extra columns in its hidden columns.
    Attached Files Attached Files
    Last edited by caddcop; 01-19-2012 at 01:19 PM. Reason: Additional Information

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1