+ Reply to Thread
Results 1 to 13 of 13

Excel 2007 : Switching Data Sets using a Check Box

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Switching Data Sets using a Check Box

    I have a data set made up from cells A1:CK6000 which is used to feed numerous charts and a data table. Columns CM to CP act as data filters in that, depending on the entries in Columns D, Column CM will read either 'Yes' or 'No', so I can filter out various options from the sheet. The same is the case for Columns CN to CP, filtering out options in other columns. Effectively CM to CP allows the source data to be filtered in a combination of different ways.

    Having built the front end to the raw data I've now been asked to incude various filtered data options in additition to the raw data. The filtered data will affect all 200 charts and the figures in the data table.

    I can obviously write various SUMIFS formula to filter the data based on the entries in columns CM to CP, but I'm trying to find a way to then use this filtered data to update all my charts and data table on my 'dashboard'. I would like to be able to simply add a few checkboxes, so the user can check them according to what they want to see and have the existing data somehow update automatically or for the dataset to switch between different data sets, but I really have no idea the best way to approach this and I would be grateful for any help, ideas or suggestions.

    As an example I use my raw data to calculate totals using a formula like this:

    Please Login or Register  to view this content.
    To add one of the required filters, I would amend my formula to this:

    Please Login or Register  to view this content.
    By doing this, every total in my original data set will change (this affects around 540,000 entries) and I need the user to be able to view the charts using both the raw, unfiltered data (as they are currently) and then the same charts using the filtered data. I should menition that the user only has access to the front end 'user interface/dashboard' and not the underlying data.

    All my charts and my data table are currently based on the first set of formula. My quesion is, how can I now add a checkbox (or whatever) to allow the user to now filter the data or switch the data (or whatever) to display all the results using the filtered data set?

    I hope this makes sense...

    I would be grateful for any help, ideas, suggestions as to the easiest way to approach this problem.

    Even if I build numerous, completely new data sets based on the filtered data, how can I switch between the various data sets using a check box or is there a much simpler approach? I would ideally prefer NOT to have to build a new data set for each filter option but to somehow use the raw data set and be able to do somethig clever with filters/formula, bearing in mind there are some extremely lengthy formula in place already.

    Many thanks for any help, advice, pointers, guidance, examples...
    Last edited by HangMan; 07-11-2012 at 01:18 PM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Switching Data Sets using a Check Box

    Maybe you can work with a pivot table.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Switching Data Sets using a Check Box

    Make the check box select value of the 2nd condition. Hence if the checkbox isnt checked the formula should reflect

    =SUMIFS(AR8:AR6000,A8:A6000,"London",CM8:CM6000,"*")

    If checked

    =SUMIFS(AR8:AR6000,A8:A6000,"London",CM8:CM6000,"Genuine")

    So based on checking,non-checking of the checkbox, it'll toggle between "Genuine" & "*"

    One limitation though is that =SUMIFS(AR8:AR6000,A8:A6000,"London",CM8:CM6000,"*") will not sum values where only 1st condition "London" is met and the corresponding 2nd condition column is blank.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Switching Data Sets using a Check Box

    Hi oeldere,

    Unfortunately, I don't think a pivot table will realy help here as it isn't something the user will be able to manipulate, but thanks for the input...

  5. #5
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Switching Data Sets using a Check Box

    Hi Ace_XL,

    Fortunately both columns A and CM are fully populated, so that sohuldn't be a problem.

    To do what you're suggesting, would that involve creating a second data set. My raw, initial data set is already using =SUMIFS(AR8:AR6000,A8:A6000,"London",CM8:CM6000,"*"), to provide totals from the main data set, would I need to create a second data set to give me the rsults of =SUMIFS(AR8:AR6000,A8:A6000,"London",CM8:CM6000,"Genuine") and then switch between the two? I've not explored check boxes before, so this is new for me.

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Switching Data Sets using a Check Box

    Nope, no need for a second data set. The idea is to make the checkbox pick either "Genuine" or "*".

    I have uploaded a sample worksheet depicting the same
    See if you can adapt this to your worksheet
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Switching Data Sets using a Check Box

    Ace_XL,

    This is cool and so simple. I really think it could work for my needs. I'll experiment with it and let you know how I get on. From looking at it quickly, it would appear as if it could provide exactly the solution I'm looking for without any major reworking of the source data, but I may have spoken too soon... I'll let you know.

    Is it okay to come back to you if I have any questions?

    Many thanks...

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Switching Data Sets using a Check Box

    Will be glad to see it come to life. Good luck and yes do write back with any feedback/queries!

  9. #9
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Switching Data Sets using a Check Box

    Ace_XL,

    All working extremely well apart from one thing.

    One of the check boxes needs to meet two different criteria and I'm having problems adapting the SUMIFS formula.

    So, far I've got this, which doesn't work...

    Please Login or Register  to view this content.
    Basically when one of the chekboxes is selected the formula should match the criteria in $BW$8:$BW$5781 when $AN$2 = True as well as matching the criteria in $BX$8:$BX$5781 when $AR$2 is also True.

    Any ideas as to how I would tweak that?

  10. #10
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Switching Data Sets using a Check Box

    Um, so I guess I need to actually get this formula to recognise two conditions, rather than the SUMIFS formula, just unsure how that would work?

    Please Login or Register  to view this content.

  11. #11
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Switching Data Sets using a Check Box

    Don't you think another separate checkbox would do the trick? From what I understand, there are 2 conditions which can either be met/not met, which gives us 4 scenarios
    1. TRUE,TRUE
    2. TRUE,FALSE
    3. FALSE,TRUE
    4. FALSE,FALSE

    You could then use something on the lines of

    =IF(AND(AM2=TRUE,AN2=TRUE),"Genuine",IF(AND(AM2=TRUE,AN2=FALSE),"???",IF(AND(AM2=FALSE,AN2=TRUE),"???!!","*")
    ))

  12. #12
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Switching Data Sets using a Check Box

    Hi Ace_XL,

    This worked perfectly, once I'd figured it out in my head for my sheet. I realised I needed radio buttons rather than checkboxes and the addition of a third condition, so this is what I ended up with:

    Radio Button 1
    =IF(AND(AI2=TRUE,AL2=FALSE,AP2=FALSE),"*","*")

    Radio Button 2 (when the first criteria is True)
    =IF(AND(AI2=FALSE,AL2=TRUE,AP2=FALSE),"Genuine",IF(AND(AI2=FALSE,AL2=FALSE,AP2=TRUE),"Genuine","*"))

    Radio Button 2 (when the second criteria is True)
    =IF(AND(AI2=FALSE,AL2=TRUE,AP2=FALSE),"No",IF(AND(AI2=FALSE,AL2=FALSE,AP2=TRUE),"No","*"))

    Radio Button 3
    =IF(AND(AI2=FALSE,AL2=FALSE,AP2=TRUE),"Unlikely","*")

    Many many thanks for your help with this, it proved to be a 'simple' but extremely effective solution.

  13. #13
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Switching Data Sets using a Check Box

    Great! Yep, you could do it with radio buttons.

    As you aptly put it, simple yet effective! Good luck. God bless!

+ 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