+ Reply to Thread
Results 1 to 6 of 6

Creating a GUI data calculator, running functions with multiple criteria

  1. #1
    Registered User
    Join Date
    04-13-2015
    Location
    New York, NY
    MS-Off Ver
    MS Office 2011 for Mac
    Posts
    4

    Creating a GUI data calculator, running functions with multiple criteria

    Hi all,

    With some minor experience with vba, I am still pretty new to excel, but a quick learner! Please keep that in mind as you read on.

    I have a bunch of data in a spreadsheet, and so far I've been able to create a user form to add entries to this data.

    Now, the next thing I want to do is create a GUI that filters and calculates the data in numerous different ways.

    This is a screenshot of what some of the data looks like:
    Image 1
    Screen Shot 2015-04-18 at 4.18.46 PM.png

    Here's a summary of the types of calculations I want to do and the criteria that would follow:
    Image 2
    Screen Shot 2015-04-18 at 4.20.05 PM.png

    I want to be able to have a GUI where I can check a bunch of criteria, then choose a calculation method to run on the data under that criteria. Here are some examples for clarification:

    Example 1: Calculate the average of how much the 20lb washer brings in.

    Example 2: Calculate the average of how much the 20lb washer brings in on Saturdays.

    Example 3: Calculate the average of how much the 20lb washer brings in on Saturdays, when the weather conditions are "Sunny".

    Example 4: Calculate the average of how much the 20lb, 30lb, and 40lb washer bring in on Saturdays and Sundays, when the weather conditions are "Rain" or "Snow".

    In other words, when looking at the summary of calculations/criteria image (Image 2) imagine a checkbox next to each criteria, so that ideally you can run any calculation using any criteria (no matter how many).

    I understand this is probably a pretty big task, so I'm not asking anyone to spell out the entire process. Rather, I would appreciate any/all suggestions/tips/related posts/tutorials/methods of implementing this.

    Note: I have tried using the AVERAGEIFS function...the issue is once you start piling up the criteria, you need an awful lot of functions...

    I want to be able to run these calculations at any time, with any criteria (which is why I was thinking of a GUI).

    ALL GUIDANCE IS MUCH APPRECIATED

    Thanks in advance!!

    Edit:
    Attached is a sample mock-up of the data and the four example calculations.
    ForumExample.xlsx
    Last edited by AlexDobbin; 04-18-2015 at 06:02 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Creating a GUI data calculator, running functions with multiple criteria

    Hi, welcome to the forum

    Note: I have tried using the AVERAGEIFS function...the issue is once you start piling up the criteria, you need an awful lot of functions...
    If you want to run an average based on a bunch of different criteria, thats the way to do it.

    Another option would be to create a bunch of helper columns to combine various criteria, then use that for the averageif() function

    On a side note - please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff), and in many cases, pics dont even show up in this forum,

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-13-2015
    Location
    New York, NY
    MS-Off Ver
    MS Office 2011 for Mac
    Posts
    4

    Re: Creating a GUI data calculator, running functions with multiple criteria

    Thank you for your speedy response!

    Here's a sample of the data and manual calculations of the 4 examples I gave above:
    ForumExample.xlsx

    If using =AVERAGEIFS is the best option....is there a way of turning these 100's of combinations of criteria into an easy GUI like structure?

    Thanks!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Creating a GUI data calculator, running functions with multiple criteria

    I put a Pivot Table together for this.

    In L1, you would pick 1 or more days
    In L2, you would select 1 or more weather conditions

    Play around with it and see if this will help you?

    Note, as/if you add extra data, you will need to updata the range (or you could indicate a larger range than you need) and refresh. You can find these under PT Option - Data
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-13-2015
    Location
    New York, NY
    MS-Off Ver
    MS Office 2011 for Mac
    Posts
    4

    Re: Creating a GUI data calculator, running functions with multiple criteria

    Wow! I just spent 5 minutes playing around with it and it seems like that's exactly what I want!! THANK YOU!

    My one concern is the limitations on Pivot Tables... I have 1000's of rows... Can Pivot Tables use calculate ALL those rows? If not, is there an alternative solution? I'm using a Mac

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Creating a GUI data calculator, running functions with multiple criteria

    Im really happy that does what you want

    That range should not be a problem - try it and see?

    Let me know how you make out?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 03-17-2015, 01:35 AM
  2. Replies: 1
    Last Post: 02-03-2015, 01:34 AM
  3. [SOLVED] Creating a Price calculator using drop down boxes for multiple BOM's
    By sjkoehl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2014, 01:40 PM
  4. creating VB code using advanced search criteria with multiple data validation lists?
    By Jonathan Bay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2011, 09:56 AM
  5. creating multiple functions/formulas in a cell
    By MaureenNB in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-16-2011, 03:23 PM

Tags for this Thread

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