Using Solver to Assign Items to Buckets

Share

Facebook
Twitter
LinkedIn

In April 2011, Mdsuhair asked a question at the Chandoo.org Forums

What formula can I use to divide a group of numbers into 2 groups so that the Sum of each of the 2 groups is as equal as possible?

This is a candidate for Solver.

This post will walk us through the solution to the problem using Solver. It uses Solver and screen shots from Excel 2007.

All versions of Excel have solver available. Users should note that the screen shots may not match your version although the functionality will, some of the functions appear in different locations in different versions of Solver.

What and Where Is Solver

What is Solver

Solver is an Excel add-in that can solve problems by enabling a Target cell to achieve some goal.

This goal may be to minimse, maximise, or achieve some target value.

It solves the problem by adjusting a number of input cells according to a set of criteria or constraints which are defined by the user.

Where is Solver

Solver is an Excel add-in supplied with Excel, but not enabled by default.

To enable solver

File, Excel Options, Add-ins, Manage Excel Add-ins, Select the Solver Add-in checkbox

Solver will now appear as a New Tab on the Data, Analysis Tab

Solver Example

This post is based around a worked example Solver Example File, the file is compatible with all versions of Excel.

Defining the Problem

Mdsuhair had a series of 8 Items each which had a value:

 

He wants to know which items should be combined so that the sum of the values of the items is nearly equal.

To do this we need to assign each item into a Bucket. Namely Bucket A and Bucket B.

We will put values of 1 into a Bucket for each Item to show that it is assigned to that Bucket and a value of 0 to show that the bucket is empty (In/Out) Value.

We can start by adding a Total Column, which counts items in Buckets A + Bucket B for each Item, It then totals the totals.

We also know that we need to work out the Value of each Item in each Bucket

We do this by multiplying the Items Value by the Buckets (In/Out) value

Finally we need to add up the values in each Bucket and work out the difference between them

Mdsuhair’s original problem was to minimise the difference between the sum of the values in the 2 buckets.

Now we can place values of 1 in the buckets manually and Excel will show us the value of each Bucket and the Difference between them in Cell G11.

I have applied some conditional formatting to show when a cell has a value > 0.

The problem is that there are 28 or 256 combinations of answers, and to test them all manually at 1 every 5 seconds would take 21.3 minutes, assuming we can keep up that pace and remember which was the best combination.

This is where solver comes to the fore.

Applying Solver

To apply solver we need to define a series of requirements, rules and constraints.

These requirements, rules and constraints guide solver and set limits which allow solver to quickly narrow in on the answer.

What are our rules

Our main requirement is to minimise the difference between the value of the 2 buckets.

The difference between the 2 buckets in our example is cell G11, the sum of Bucket 2 values minus the Sum of Bucket 1 values.

We want to have G11 as low as possible but greater than or equal to 0.

 

We also know that an item can only be in Bucket A or Bucket B, it can’t be in both and can’t be Broken apart.

That is 2 Constraints for each Item

Firstly The Total column must be equal to 1

Secondly the Buckets Values must be Integers

We also know that the Total Number of Items is 8, this is another constraint.

We will discuss how these constraints are used in the next section

The Solver Window

This section will explain the solver window and its use in defining the problem within solver.

A Blank Solver Window

A Filled Solver Window

Set Target Cell:

This is the Target cell which is the cell which you are trying to solve the problem for.

Our Target cell is G11, The difference between the 2 Buckets values

Equal To:

The Equal To: section defines what we want to do with our Target Cell.

We want to achieve the same value in each Bucket and so the difference between the Buckets will be 0.

It might sound strange but we don’t want to minimise that difference. A minimal value will be achieved when all the Items are placed in Bucket A, as our equation for G11 will then have 0 – Total which is –Total, which is more minimal than 0.

Another way to constrain this is to Change G11 to =Abs(G10-H10)

This allows us to use Min as an Equal To: Value

But for now we can just leave G11 as =G10-H10 and we will set the Equal To: section as 0.

By Changing Cells:

Changing Cells: refers to the cells which will be modified by Solver to try and solve the problem.

We want to let Solver change the number of items in each bucket, this is the range: $C$2:$D$9

Hint: You can try the Guess button next to the Range Reference and Solver will take a Guess at what cells the problem is dependent on.

Always check this if you use it, especially in complex models.

Subject to the Constraints:

Constraints are the rules which define the limits of the possible solutions to the problem

We will add several constraints for our rules:

1. The Total column must be equal to 1 for each Item

2. The Bucket Value must be an Integer

3. The total contents of the 2 buckets must be 8 items

4. You could add a further constraint that each Bucket should hold the same number of items

Hint: As a general Rule, Under Constrain rather than over constrain! You can always add more constraints later.

To do this we will use the Add Constraint Button

1. We need to add a constraint for each cell in the Range E2:E9 that it is only allowed to be = 1

This constraint must be applied for each cell in the range E2:E9

2. We need to add a constraint for each cell in the Range C2:D9 that it is only allowed to be an integer

This constraint must be applied for each cell in the range C2:D9

3. We need to add a constraint for the Total of the 2 Buckets, E10=8

You can Change or Delete Constraints if you make a mistake by selecting the appropriate constraint and using the Change or Delete Buttons

Save and Load Solves Parameters

Selecting the Options Button there is the Option to Save Model and Load Models.

Hint: The Save/Load Models has been shifted onto the main Solver dialog in Excel 2010.

Using the Save Model and Load Model options you can Save and the Load the Solver Parameters for your model. The Save Model saves the parameters in a Range of cells as shown below.

This allows an easy way to actually setup and/or change the solver parameters.

Hint: Setup one constraint using solver then Save the model. Edit the model on the worksheet and re-load the model as required.

Note: That the parameters although when saved show as True/False or Numbers are all Excel Equations, see above.

This means you can edit them to change the Constraints and Parameters as required and re-load them into solver.

I have included 3 sets of Parameters for our model.

These are:

  • Base Case – Forces bucket values to be equal, Allows uneven bucket counts
  • Equal Sized Buckets – Forces each bucket to contain the same number of items
  • Force an error – Which forces an error in the solver model

Load each model and try them at your leisure.

Running the Solver Model

Warning: Solver is a computationally complex add-in, so once your model is setup, Save your Workbook.

Prior to running the model there are a few parameters we should look at to ensure the model solves correctly.

On the main Solver window select the Options button. (Some of these parameters are on the Main Solver window in Solver 2010)

Generally you can accept the defaults but in this case we will change the following

Assume Linear Model – Select

Assume Non-Negative – Select

Note: Solver in Excel 2010 will return a better answer without these 2 parameters enabled by default

The other 2 parameters which you may need to change from time to time is

Precision: Precision is a number from 0 to 1 and higher means more precise

Tolerance: Tolerance shows how far away from a Number, an Integer constraint is allowed to be

The use of the Estimates, Derivatives and Search parameters are beyond the scope of this post. I direct you to the Excel Help on these subjects, by selecting the Help button.

Run the Model

To Run the Model, select the Solve Button from the main Solver menu.

The main status bar in Excel will flash up a number of statistics about the internal workings of the Solver add-in. Generally these flash by and are too fast to read. If a model is too complex it may stall and you won’t see any movement for a while. Solver generally recovers from these problems itself.

 

Once the Solver model finishes it will display a dialog of the results and allow you to do several things

First thing to note is that “Solver Found a Solution.

If it has found a solution, the worksheet cells will be changed to show the solution

You now have 4 options:

  • Run a Report
  • Save a Scenario
  • Return to the model
  • Check Your Results

Run a Report

Run a report by clicking the report you want.

A new sheet will be added to your workbook depending on the report but will be called:

  • Answer Report 1,
  • Sensitivity Report 1
  • Limits Reports 1

etc.

Note, that not all reports are relevant at all times, depending on the Constraints you have applied.

Save a Scenario

Selecting the Save a Scenario button takes you to the Save Scenario dialog.

 

Type in a Name and the Scenario of your model is saved as a Scenario.

Scenarios as available for use in the Scenario Manager, which is accessed from the Data, What-If-Analysis Tab

Return to the model

You can return to your model and either:

  • Keep Solver Solution
  • Restore Original Values

Check the Results

Solver is probably the most Black Box’ish of systems within Excel. As such any results it puts out must be manually checked for suitableness before further use.

These checks for realness, should as a start confirm that the results meet all the criteria supplied.

Are the results roughly what were expected?

Are any Minimums or Maximums violated?

 

What If Solver Doesn’t Find a Solution?

From time to time Solver will return with an error that a “Solver could not find a feasible solution.

When this happens it is indicating one of several possibilities:

  • Your model is over or under constrained
  • Your model constraints are impossible to meet
  • Your model constraints have an error

Start by checking the current constraints for errors and ambiguities

Eg: in our case we have 8 items so requiring the Count of the two buckets to be 20 is impossible to meet

 

My Solver Answer has Strange Numbers?

In solver up to and including Excel 2007, solver would commonly return numbers like 3.5E-18.

This is 0.0000000000000000035, which is effectively 0

If your model returns these, feel free to go through the model and change them to 0, in our model we should also check as the corresponding 1, may in fact be 0.9999999999999999965.

It should be noted that this problem in Solver in Excel 2010 does not occur as often but will still occur.

 

What and How have you used solver in the past?

What and How have you used solver in the past?

Let us know in the comments below:

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

122 Responses to “10 Excel Keyboard Shortcuts I can’t live without!”

  1. Anup Agarwal says:

    Nice,

    Mine would be Ctrl + R (to fill right) and Ctrl + D (to fill down). I just love making good formulae which can be used all over the table.

  2. Radu says:

    Mine are (not in this order): Ctrl+S (save), Ctrl+W (close active workbook), Ctrl+PageDown/PageUp (navigate to the next/previous worksheet), F4 (toggle references), Ctrl+A/X/C/V (select all/cut/copy/paste), F9 (calculate).

  3. zaur says:

    I use ctrl+shift+1 for convert value to number format

  4. Finnur says:

    I'd add ctrl+shift+arrows to select tables and F9 to see what part of my larger than normal formula went wrong. Plus the standard ctrl+c, ctrl+x and ctrl+v.

  5. Jennifer says:

    Some of those mentioned already (eg CTRL + PageUp / PageDown to flick between tabs) but shift + f2 to add a comment and CTRL + 8 / CTRL + 9 to hide a row or column or CTRL + SHIFT + 8 or 9 to unhide. Oh and CTRL + SHIFT + $ to comvert a value to currency

  6. Paul Maddock says:

    I use the excel quick access toolbar, and use the corresponding alt+1-9 for my most used short cuts. So on there I currently have filter, paste values, pivot table, excel options, paste formulas which are my most used shortcuts.

    But apart from that f5 (go to function for blank, constants formulas).

  7. Stephen says:

    well I'm going to tell you I Use
    Alt+1 = paste values
    Alt+2 = paste formula
    Alt+3 = paste formats
    how?
    Excel 2007 - you can add items to the quick access toolbar and then when you press ALT it assigns them all a number/letter. it's just a case of finding the right commands.

    • Jason says:

      Excellent... made me look for them and when i did get them i just went crazy... hahahahahaha... thanks a lot stephen....

  8. Hui... says:

    Most of Chandoos and
    Ctrl Pg Up/Down - move to next active page
    Alt F11 - open VBA Editor window
    Ctrl F6 - Scroll between open workbooks
    Ctrl ~ - Show/Hide Formulas

  9. Alan says:

    For Tip #4 I always use CTRL+ALT+V, I find it easier on the fingertips.

    4. ALT+ES – Paste Special > Values

  10. Gaylen says:

    I have created a macro for the functions that I use most:

    Ctrl + shift + L to hightlight cell
    Ctrl + shift + M to unhighlight cell
    Ctrl + shift + O to paste formula
    Ctrl + shift + T to past format
    Ctrl + shift + E to format as accounting
    Ctrl + shift + I to use % format. and these excel. and many of the other tips mentioned.

    • Daniel says:

      how did you make these macros? Thanks!

      • Gojak says:

        Hi Daniel
        Simple - just record a macro of the action you want then when you save there'll be an 'assign shortcut' option for you. You can also change them after if you find it's not that convenient or you forget it too easily.
        Cheers

  11. Fred says:

    Using 2007 version:
    Crtl-tab to toggle in and out of excel with another workbook or applicaiton (word, ppt, outlook, etc). I prefer this over Crtl-F6 because i only need to use my left thumb and index finger instead of 2 hands for Crtl-F6. To me, the keys Crtl-F6 is too far away from one another, even if I don't have to worry about toggling to other applications like crtl-tab.

    Crtl-Pg Up and Crtl-Pg Down: too many worksheets to do QC work after each project/update.
    Shift+End+arrow key or Crtl+Shift+arrow key: depends on if i want the whole column/row/area.
    F4 for ease of formula control.

    Crtl+F to find/replace text, numbers, formula checking, etc.

    I have all paste special on the access tool bar instead. there are too many situations to use.
    Crtl+~ to see all cells with formulae.

    F2: not only edit the formula but to hi-light and understand where others cells are linked to this cell, if any.

  12. Dennis says:

    I use
    Ctrl + spacebar to select entire column,
    Shift + spacebar to select entire row
    Shift + Ctrl + spacebar to select all datas in the worksheet
    Ctrl + 0 to hide a column
    Ctrl + Shift + 9 to unhide a column
    Ctrl + 2 to bold

  13. Mick Coleman says:

    Guys - you can't live without Ctrl + Z - just as you can't live life without an eraser.

  14. Tom says:

    Here are a couple that haven't been mentioned yet (I think)...

    ALT + = (Autosum)
    CTRL+A (Select data/all)
    CTRL+Space (Select column)
    SHIFT+Space (Select row)
    CTRL+SHIFT+F3 (Create Names)
    CTRL+5 (Strikethrough)
    ALT+ENTER (Mutliple rows in cell)

    I've noticed that the unhide column shortcut (CTRL+SHIFT+0) stopped working when I updated to Windows 7...anyone know why (or a workaround)?

  15. tamoghna9 says:

    All time best CTRL+SHIFT+Down arrow to select contiguous cells ( along a column)

    ALT+N+V+T to insert pivot table

    ALT+E+A+A to clear all ( very handy!!!)

    ALT+F1 to insert default chart in current sheet

    arrow key to toggle between chart elements

  16. David says:

    In addition to the obvious Control + C/X/V (Copy, Cut, and Paste), I use ALT + = to insert AutoSum. This is realy handy.

  17. Jonny says:

    Definitely Shift or Cltr + Space Bar, then Ctrl + or - to add/delete a row/column.

  18. Stružák says:

    1. Ctrl + Page Up/Down - jump to previous/next worksheet
    2. Ctrl + Home - jump to the top of the worksheet
    3. Ctrl + F3 - displays the Name manager
    4. Ctrl + 1 - format
    5. Ctrl + ; - paste today's date
    6. Ctrl + W - close active workbook
    7. Shift + F11 - adds new worksheet
    8. Shift + F3 - insert formula
    9. Ctrl + 9 - hides selected row
    10. Ctrl + 0 - hides selected column

    Btw thanks a lot for "CTRL+SHIFT+L – Turn on/ off filters", I have to learn that. 🙂

  19. Alan Murray says:

    Mine have to be:

    Ctrl + Shift + + to insert a new row/column/cell
    F9 to run formulas. Great for testing parts for a formula
    Ctrl + D to repeat the cell above

    • Felix Murillo says:

      Yeah man, control+d
      Thumbs Up for this shortcut, specially when you work with a lot of data base, just create your formulas and Bualaa. Bless people.

  20. Pam says:

    Ctrl + z = Undo is one I use a lot

  21. Les Goins says:

    Didn't see these--

    Being right-handed, using thumb and forefinger...:-)
    Cntrl + Insert for Copy
    Cntrl + Delete for Cut

    Whenever I'd go to new company, had standing invitation: if anyone knew more ways to "copy" than I, I'd buy lunch... this was always the winning #7"...:-)

    How many ways y'all know...?? Im ready to buy lunch...:-)

  22. Les Goins says:

    yep--#2 is good--- but I use Alt + D+F+F which only takes one hand and leaves right hand for coffee...:-)

    and, since I discovered "MS Flag key + M" to close all open windows and put u at Desktop...I use it multiple times a day...

  23. David says:

    F12 - Save As...

  24. Rohit1409 says:

    Yes agreed with CTRL - Z, but hey don't forget his brother CTRL - Y [Redo] 🙂

  25. hasanlianar says:

    Ctrl+Alt+V for Paste Special
    Alt DFF for Filtering
    Alt ASD for Sorting in decending order and Alt ASA for Sorting in ascending order
    Ctrl PageDown/PageUp for navigation over sheets

    etc.

  26. Arun Kumar says:

    Can someone put all these shortcut keys in photoshop and share the link so that we can put it as a wall paper.

  27. Hi,

    very useful post!

    Mine are:

    Shift-End- - selecting used fields
    F4
    CTRL-S

    Thanks for the inspiration - I love the cheat-sheet wallpaper idea.

    P.S.: Where's your flattr-button?

    Thomas

  28. Amit Dhingra says:

    Mine will be

    F11 - Create a chart
    Alt + D + F +F - To turn on/ off the auto filter

  29. Graham says:

    Really good post, lots of useful stuff here!
    One of my most used not mentioned already (i dont believe!):
    ALT + SHIFT + F1 - add new sheet to workbook

  30. Sidhesh Mangle says:

    1 of my best short cut is to Check which cells/worksheets are referenced/used in formula
    -> Ctrl + [
    Works only on the cells which has formula. it Jumps directly the dependent cells
    & Ctrl + ] works for those cells which will be used in formula (Dependents)

    • Adam Turco says:

      Thank you so much for showing me what this Ctrl Function does, i used it by accident and have struggled to figure it out. Now I'll use it all the time!!

  31. Fowmy says:

    To freeze and unfreeze panes

    ALT+W+F+F

  32. Steen says:

    A couple of my favourites I haven't seen mentioned:

    ALT E+S for paste special, use all the time for copying formats, values formulas, etc.
    ALT E+I+S useful for creating values in a series
    SHIFT ALT right arrow to group, ALT D+G+H to hide group ALT D+G+S to show group.
    ALT+TAB to navigate between open windows.

  33. Chris says:

    @Steven, thanks for the tip on using the quick access toolbar. I just rearranged mine.
    In addition to many of the shortcuts listed above I use F4 to repeat an action and CTRL+N to open a new workbook

  34. Fred says:

    @Les Goins

    I tried Crtl+Del but it only delete. it is not cut if we can't paste it back somewhere else, right?

  35. Les says:

    ...:-) Sorry, Fred (And, all others...)

    should be "SHIFT + Delete key" to "Cut"... THEN, just hit Enter, or Cntrl V to Paste

  36. bansi says:

    CTRL# to format dates!!

  37. Darshan says:

    Hi All,

    My fav or top are
    1 alt+dff for auto filter
    2 alt + es, followed by, v, c, w, etc for paste special
    3 Ctrl + navigational keys to move around in workbook
    4 ctrl + space select entire column
    5 shift + space select entire row
    the list will just go on... in a nut shell all short cut Handled by left hand and right hand for the mouse + defnitely coffe 🙂

  38. Stephen says:

    @Chris, glad i inspired.
    a couple more favourites of mine:
    Alt & ; = select visible (really useful when working with autofilter)
    Ctrl&PgUp/PgDn = move left/right on a sheet (useful when you have a lot of columns)
    Ctrl&Tab (or Ctrl&Shift&Tab)= switch between workbooks (& the other way back)
    Alt&Tab (or Alt&&Shift&Tab) = switch between applications (& the other way back).... however, if you note that it always takes you to the last used application first, then press & release both repeated will flick you back and forth between 2 applications or 2 workbooks without having to press the shift. I use this if I have to complete journals, where I have to take data from Excel and post into our accounting package.... with Ctrl&C/Ctrl&V.

  39. Vinodh Raj says:

    I use the following short cuts often
    1) Alt D,F,F - AutoFilter
    2) Ctrl+space - Select entire column
    3) Shirt+Space - Select entire row
    4) F12 - Save As
    5) Alt + F,C - Close workbook
    6) Alt + F,X - Close Excel application
    7) Ctrl + 1 - Format Cell
    8) Context menu key (next to win key) + S - Paste special
    9) F4 - Repeat the last action
    10) Ctrl + PageUp, PageDown - To browse through worksheets

  40. Clarity says:

    Everyday shortcuts for me:
    CTRL + C Copy
    CTRL + X Cut
    CTRL + V Paste
    CTRL + D Copy from above
    CTRL + Z Undo
    F4 Repeat (or scroll through referencing)
    F2 Edit cell
    CTRL Page Up/Page Dwn Move to next/previous worksheet
    CTRL + * Select current region
    CTRL + Home Go to top left cell

  41. Gojak says:

    CTRL + ; insert date - I use a lot but I like to have the keystrokes the way I want so I make tiny macros for my faves and give them my own key combos.
    CTRL SHIFT + V = Paste Values is much easier than the built in for me because it's a natural follow-on for CTRL + C.

  42. Andy says:

    I use "CTRL+[ " This takes you to the source of your formula and I use it every day.

  43. Gaylen says:

    The "CTRL+[" Is fantastic. Thanks for Sharing.

  44. Hui... says:

    @Andy & Gaylen, All
    Don't forget about Ctrl+]
    which follows a cell to it's next dependants
    Both of Ctrl+[ and Ctrl+] can be used iteratively to move up/down the dependancy tree

  45. Gojak says:

    Great ... thanks everyone for the tips.
    BTW - it's interesting how good it is for us all to be human filters. Instead of a bamboozling blur of what you could possibly use, it's: here - you'll probably like this one ... I do.

  46. Jennifer says:

    @andy and hui

    I'd not come across the CTRL + [ or ] before so thanks! I can't imagine how useful they'd have been over my career so far. Great tip

  47. Siddique Sayeed says:

    really helpful

  48. SARAN KUMAR says:

    My list is bit more..

    Ctrl+page up/down to move between tabs
    right click+p+s for paste special values (i use most of the times keyboard right click..since it is very near to fingers)
    alt+d+f+f and again alt+d+f+f to remove all the filters and add filters again
    ctrl+tab to move between open workbooks
    ofcourse F2 very commonly
    Shift+F11 very frequently to add new worksheet/tab
    alt+o+h+r and alt+o+c+a are my best shorcut keys to rename tab and auto fit the cells
    (ctrl+c/x/z/v/b/u/i/S..like everyone)

    Regards,
    Saran
    lostinexcel.blogspot.com

  49. Marek says:

    Since I use Conditional formatting very often i always use ALT+O+D

  50. Gojak says:

    Just thought of another
    for wrap and unwrap, ctrl+w and ctrl+q+w (quit wrap)
    because I do it a lot and it's too fiddly to do through menus.

  51. Akansha says:

    Hi use ALT+DFS on a daily basis- incase you have filtered a sheet against 5-7 filters and you want to remove all filters then this is the easiest.

  52. Duy Dang says:

    Ctrl + Alt + V ----> paste special

  53. Cezar says:

    Ctrl + F6 = navigate between differetn Excel files.
    Ctrl + PgUp/PgDn = navigate between sheets
    Ctrl + Home/End
    Ctrl + Arrows
    Shift + lots of keys... 

  54. Jevi says:

    ALT + ; - to copy visible cells only. I have to use it quite often and a lot of them you have already mentioned :).

    thank you for sharing.

  55. Prathap says:

    Ctrl+shift+L for Autofilter and remove the filters

  56. Anton says:

    My Favourites (which I use all the time):
    Ctrl + 1 - cell formats
    Ctrl + D - copy values Down
    Ctrl + R - copy values Right
    Alt + DFF - toggle filters on / off
    Alt + WFF - toggle freeze pane on / off
    Alt + HVF - Paste Special; Formulas
    Alt + HVV - Paste Special; Values
    Ctrl + C then Alt + HVV - removes formulas (especially handy when selecting whole sheet)
    Alt + ADFROT - Advanced Filter to get Unique values for a column, to new location
    Alt + DPF - insert quick Pivot Table

  57. Oz says:

    Hello everyone.

    I'm going to admit that I don't use keyboard shortcuts beyond Copy and Paste.

    Why not? Every software and OS has their own keyboard shortcuts and I have a fear of them overlapping.

    One keyboard shortcut might do something cool in Excel but in my music composition software that shortcut might mute the drum track. In my video editing software is might the the shortcut for opening the effects menu.

    Shortcuts are really cool but I've gone 15 years working Excel, writing VBA code, and making a living without memorizing keyboard shortcuts. Only recently have I been willing to admit that.

     

    • Hui says:

      @Oz
      Your missing out on huge increases in efficiency
      Most of the normal shortcuts are similar throughout all applications
      Ctrl C, V X - Copy, paste Cut
      Ctrl O - Open
      Ctrl S - Save
      Ctrl P - Print
      and several other of a similar nature
       
       

      • Oz du Soleil says:

        Hiu,
        I see what you're saying but still disagree. The efficiency that I'm missing out on is small. This isn't like I've declared refusal to use pivot tables.

        Shortcuts were screwing me up when I switched from Excel on my PC and Excel on my Mac. CTRL C, CTRL V are useful and universal. I do use those.

        The only thing I can see is that I'd be in trouble if I joined one of those Excel tournaments.

        One mildly humorous reaction: when you mention CTRL P for printing, I never just straight print. The printer manufacturers have things set up where you can't set a printer to default to printing in draft mode. So, I always manually go to the print menus and adjust the settings to draft mode.

        Any way ... the bottom line is that I don't work in an environment where shortcuts will make or break me.

  58. Heather says:

    I use one program that has Ctrl C and Ctrl V for inbuilt shortcuts and it drives me nuts because I use them all the time. The Shift+Ins is the one I need to use in that program.

    Another Excel one I use often is Ctrl+' to copy the data from the cell above. Several others that have already been listed. 

    My new laptop has the "F" buttons combined with other buttons. To save space on the keyboard I guess. Whenever I'm at home and hit F2 to edit it toggles my wi-fi on and off. Grrr. I have to hold the function key then hit F2 to activate the F2 function.

    So glad I found this page. Paste values only is the shortcut I was looking for. Found it. 🙂 Thank you. 

    • Kenneth says:

      lots of people at my office use a background program to assign keyboard shortcuts.  Drives me crazy because they use existing keyboard shortcuts like ctrl-a to shoot off a macro, then they don't know how to select all.  Makes training them on excel a lot more difficult.

      • Michael says:

        A good background program to assign keyboard shortcuts will allow them to be application specific so that ^a does not interfere with select all in excel. A misused background program could easily result in the situation described above.

  59. Rob says:

    Highlight a row or column and use...
    Ctrl + + and Ctrl + - to insert or delete rows or columns

    • Gojak says:

      Thanks Rob - I've got double rows of toolbars all round with hundreds of buttons, so even finding my faves like insert delete row can be hard. That'll be really handy.

  60. JWS says:

    Does anyone know how to use the ALT-key (or any other key) to access the buttons on the Quick Access Toolbar (QAT) numberd with more then 2 digits? 

    • Sheeloo says:

      Just type the numbers/letters shown.

      If it says 09 just press 0 and then 9 (of course after pressing ALT to see the shortcuts assigned to QAT)

  61. Kenneth says:

    The less-common (but already mentioned here) shortcuts I use the most are:

    Ctrl-1  (cell format)
    Ctrl-Home/End  (beginning/end)
    Ctrl-Shift-Home/End  (select from here to beginning/end)
    Ctrl-PgUp/PgDn  (move between worksheets)
    Ctrl-`  (show formulae)

     

  62. Bonnie says:

    Very helpful!  Thanks!
    A couple of my time-saver favorites:
    F2 to edit a cell (helpful if I just need to delete the last character and don't want to retype the whole thing)
    Shift-F2 to add or edit a comment (then Esc Esc to get back out of it)
    Also a big fan of the Ctrl-K hyperlink one that others have mentioned!

    • Gojak says:

      Been reading these tips for a year and a half, and always something useful.
      I use a lot of comments so Shift-F2 is helpful. Thanks.
      For F2 - edit cell there is an option to 'Directly edit in cell' which I always have on. Just double click. Not only that, but the cursor will be just where you double click, so you can start middle, end, wherever you need, without another click. 🙂

  63. Bonnie says:

    I just hate to use the mouse, so I avoid double-clicking at all costs! 🙂

    • Gojak says:

      Fair enough. I change my mind regularly about that. It's a mood thing ...or if I'm eating over the KB. Bad! hehe.

  64. Sonu Kashyap says:

    CTRL + SHIFT + & (TO CREATE OUTLINE BORDER)

  65. SMTP2GO Review says:

    I've read several excellent stuff here. Definitely price bookmarking for revisiting. I surprise how much effort you put to make this kind of magnificent informative site.

  66. Craig says:

    I often use F2 followed by F9 to convert a formula in a cell to its value. It's the keyboard equivalent to copying the cell, and using Edit > Paste Special > Values on the same cell, but much quicker.

    Application? I use this a lot if I have to manually separate items on a receipt into different categories, but I still have to take sales tax into account. I'll enter certain items from the receipt into the cell, and include a quick formula to get the sales tax for just those items. When I'm done, I strip out the formula just to be on the safe side, leaving the value of the cell.

    • Gojak says:

      Thanks Craig, unfortunately when I tried this I found another app has hijacked my F9 - what does it normally do by itself? I will have to try to wrestle it back from the app.
      BTW I use paste vals so much I made a macro so I could use ctl-sh-v. The reason this is so handy is because of course I've always done ctl-v immediately before so it's really like one quick action, with the bonus that the paste val doesn't have to be in the same cell (I mean you don't have to lose your formula) Easily my most constantly used macro. If you want to give it a try ...

      Sub PasteValues()
      '' Keyboard Shortcut: Ctrl+Shift+V
      '
      'ActiveCell.Select
      'Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
      'False, Transpose:=False
      ActiveCell.PasteSpecial Paste:=xlValues
      End Sub

    • n. says:

      does it work on a range. I tried selecting a range and then F2+F9. It changes from formula to value in just first cell.

  67. Abhishek says:

    Is there a keyboard shortcut for filtering a value after adding the filters to a data?

    • Michael says:

      It might be a bit clumsy, but just use the keyboard to navigate to the filtered cell and hit Alt + Down to bring up the filtered options.

  68. RAwat017 says:

    Mine
    CTRL+* ( it will slecte all the work area)

  69. […] Our friend Chandoo, excel dashboard guru over at chandoo.org has provided us with the 10 Excel Keyboard Shortcuts You Can’t Live Without. […]

  70. Oz du Soleil says:

    Other than CTRL C, CTRL V the only other shortcut that I can't live without: CTRL+SHIFT when moving a block of data and wanting it inserted.

    After highlighting the cells that you want to move, select CTRL+SHIFT and the cursor turns into a line that you position to the place where you want the data inserted. It's pretty cool.

  71. Shmuel says:

    1. Ctrl+Enter accepts your input and leaves the cursor in the same cell. Saves you from having to go back up to continue work on that cell e.g. copy....
    2. Select a range of cells which have the same formula or content; edit the active cell only; now press Ctrl+Enter to populate the entire range with the corrected formula/content!
    3. In the middle of a formula, if you have navigated away from the active cell (e.g. to select a large range) such that it is no longer visible, you can press Ctrl+Bckspace to jump back to the active cell whilst remaining in edit mode

  72. Seheer Qatar says:

    Am using as
    Ctrl+5 for strikethrough in the content of the cell.

  73. sonali says:

    hi..
    can any one tell me what is shortcut for copy and paste all the table as it is..i knw ctrl+c and ctl=v; bt this shortcut not paste document as it is..

  74. […] the most popular posts from earlier this semester. Re-posted from February 14, 2013 Website: http://chandoo.org/wp/2011/08/08/must-have-excel-keyboard-shortcuts/ Especially useful when analyzing data, making charts and formatting workbooks. Business and […]

  75. Don says:

    The two I use all the time are:
    Ctrl + (Control and Plus sign on numeric keypad) = Insert row or column
    Ctrl - (Control and Minus sign on numeric keypad) = Delete row or column

  76. Dina says:

    Shortcut #4 is one of my favorites, but there's an important note speficially regarding Paste Special Values - you need to hit V after alt + ES. I know you have a link to that detial amongst other options within Paste Special (all of which I use all the time and LOVE), but if you're specifically noting Paste Special Values, it should read alt + ESV.

    Thanks for all your info!

  77. […] some time getting fully on board with shortcuts. As an added resource, do check out Chandoo’s post on 10 must-have […]

  78. David says:

    Great discussions!
    I have a question for No. 8 CTRL + K for Hyperlinks.
    Is there any way you can add a Hyperlink and KEEP the existing formatting of the text in the cell?
    I would assume it might be a setting somewhere where you can define the Hyperlink Design - but that would just be another single format I think - I want it to be un-formatted if anything so it picks up the current cell format. Any ideas please? Thanks everyone!

  79. Preeti says:

    Hi Chandoo,

    I do regularly read emails received by you. I use above mentioned 10 shortcuts in daily workflow. In addition to this I use following shortcuts:
    Filter Ctrl+shift+L and open filter column alt+down arrow key.
    Visible cells Alt+:
    Format Painter Copy then go to the cell which you want format right click key+S+T

  80. ce site says:

    It's an amazing article designed for all the internet viewers; they will take
    advantage from it I am sure.

  81. Liran says:

    Amazing article,
    The only thing i didnt know is ctrl+shift+l for filters and I use them alot,
    so thanks!

    And my contribution is:

    alt+h+9 > remove decimal place
    alt+h+0 > add decimal place.

    Very useful when using ctrl+shift+1 for number formatting and immediately hitting alt+h+9 twice to remove decimal places.

    Cheers

  82. Jodi says:

    I am using AutoFilter and I have a large picklist of values available to me. I want to select about the first 50% of the items. Is there any shortcut to grab them? (i.e. Select 1st item, hold shift, select last item --which does NOT work).

    Thanks!

  83. ashish says:

    how can i "clear format" from a part of selection in excel by keyboard.
    i need keyboard shortcut to clear format of any cell.
    reply me
    ashish gupta
    email: ashish99b@gmail.com

  84. Debaraj Nayak says:

    Hiii...

    Previous is wrong ...

    Clear Format:-ALT+H+L+C+S

  85. Sheeloo says:

    I think 7 should be "CTRL+F3 – Show Names"

  86. zan says:

    cool, thanks bro!

  87. Sri says:

    Chandoo, Greetings! Nice tips. Like it & use ful. To make it credible and professional, please publish without spelling, grammatical mistakes, if you may. Thank you.

  88. Bonnie says:

    Sri: The spelling and grammar are pretty accurate, if you're referring to the original article. If there is a specific spot that you feel is unclear due to grammar issues, you'll want to provide more details on what is confusing you versus just saying "please publish without spelling, grammatical mistakes".

    Chandoo doesn't have control over the grammar or spelling in users' responses such as yours, of course; if that's what you're addressing, you should address your comment to the user who posted the item which you feel has poor grammar. (You would generally only do so, though, if it's that you need something clarified because of the grammar issue.)

    I'd like to note that your post isn't actually the best in terms of spelling and grammar. For example, you capitalized "greetings" even though it's in the middle of a sentence, and you put an unnecessary space in "useful". If you're particularly bothered by poor grammar, you'll want to proofread your own posts a little more carefully! 😉

  89. Michelle says:

    This is awesome, totally on nerd overload. Here's my fav:

    Go to - special - blanks
    Then Ctrl, up arrow, =, enter

    This fills in all the blanks!

    Thanks fellow geeks for all the sweet tips

  90. Sukarnen says:

    Guys,

    CTRL+SHIFT+1 always give us number format with 2 decimals. Is there any Excel shortcut that could give us number format with 0 decimal, other than making our own macro?

    Thanks

  91. Gyan Chand says:

    these shortcut keys are really helpful in smart work & fast work

  92. piecevcake says:

    Wonderful tips, I have made my own list.
    Another good one is CTRL+F10, toggles maximise/restore window in workspace. (So you can find the scrollbars, and switch books by clicking another one)

  93. Julie Falkman says:

    I use CTRL-Z to repeat the last command. Handy for inserting multiple rows or columns.

  94. […] Here are some great Excel shortcuts copied from http://chandoo.org/wp/2011/08/08/must-have-excel-keyboard-shortcuts […]

  95. MicroSoft Office Support says:

    I use filters to do an ad-hoc analysis of my data. So, Once I set a couple of filters.

  96. Jenny says:

    Ctrl ; to enter today's date

    Ctrl ' to enter the same data as above

    Ctrl home to go to the top

Leave a Reply