=IF(@Nationality="United Arab Emirates",0,IF(@Service_Days<365,0,IF(@Service_Days<1095,@Service_Days/365*@Basic_Salary/30*7,IF(@Service_Days<1825,@Service_Days/365*@Basic_Salary/30*21,(105*@Basic_Salary/30)+(@Service_Days-1825)/365*@Basic_Salary/30*30))))
To get rid of nonbreaking spaces (html character ), replace them with regular spaces, and then have the TRIM function remove them:
=TRIM(SUBSTITUTE(A2, CHAR(160), " "))
To better understand the logic, let's break down the formula:
A non-breaking character has value 160 in the 7-bit ASCII system, so you can define it by using the CHAR(160) formula.
The SUBSTITUTE function is used to turn non-breaking spaces into regular spaces.
And finally, you embed the SUBSTITUTE statement into the TRIM function to remove the converted spaces.
If your worksheet also contains non-printing characters, use the CLEAN function together with TRIM and SUBSTITUTE to get rid of spaces and unwanted symbols in one fell swoop:
=TRIM(CLEAN((SUBSTITUTE(A2,CHAR(160)," "))))
How to convert Numbers into English words as currency in Excel
Open Excel,
Alt + F11
Insert, Module
copy the code below and paste into module(after start line and before end line)
----------------------------------------------
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dirhams, Fils, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert Fils and set MyNumber to Dirham amount.
If DecimalPlace > 0 Then
Fils = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Dirhams = Temp & Place(Count) & Dirhams
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dirhams
Case ""
Dirhams = "No Dirhams"
Case "One"
Dirhams = "One Dirham"
Case Else
Dirhams = Dirhams & " Dirhams"
End Select
Select Case Fils
Case ""
Fils = " and No Fils"
Case "One"
Fils = " and One Fil"
Case Else
Fils = " and " & Fils & " Fils"
End Select
SpellNumber = Dirhams & Fils
End Function
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) <> "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function
---------------------------------------------
Save and exit
Put any number in Cell A1
Type Formulae into A2=Spellnumber(A1)
The number will be spelled into currency
Export Sheets to Files
======================================
Option Explicit
Dim MainWorkBook As Workbook
Dim NewWorkBook As Workbook
Sub ExportWorksheet()
Dim Pointer As Long
Dim Filepath As String
Dim strFolder As String
Filepath = ActiveWorkbook.Path
Set MainWorkBook = ActiveWorkbook
'''''''''''''''''''''''''Display number of worksheets
'Range("E2").Value = MainWorkBook.Sheets.Count
Application.ScreenUpdating = False 'enhance the performance
For Pointer = 2 To MainWorkBook.Sheets.Count
Set NewWorkBook = Workbooks.Add
MainWorkBook.Sheets(Pointer).Copy After:=NewWorkBook.Sheets(1)
Application.DisplayAlerts = False
NewWorkBook.Sheets(1).Delete
Application.DisplayAlerts = True
''''''''''''''''''''''Save new work sheets
strFolder = Filepath & "\" & "ExportedSheets"
'''''''''''''''''''''''''Create dierctory if not present
If Dir(strFolder, vbDirectory) = "" Then MkDir strFolder
With NewWorkBook
'.SaveAs Filename:=Filepath & "\" & "Sheets" & "\" & MainWorkBook.Sheets(Pointer).Name & ".xlsx"
.SaveAs Filename:=strFolder & "\" & MainWorkBook.Sheets(Pointer).Name & ".xlsx"
End With
NewWorkBook.Close SaveChanges:=True
Next Pointer
Application.ScreenUpdating = True
'''''''''''''''Optional Display Message
'Range("D5").Value = "Export Completed"
'MsgBox "Done"
Shell "explorer.exe " & strFolder, vbNormalFocus
End Sub
------------------------
Sub Splitdatabycol()
Dim lr As Long
Dim ws As Worksheet
Dim vcol, i As Integer
Dim icol As Long
Dim myarr As Variant
Dim title As String
Dim titlerow As Integer
Dim xTRg As Range
Dim xVRg As Range
Dim xWSTRg As Worksheet
On Error Resume Next
Set xTRg = Application.InputBox("Please select the header rows:", "Code by Ali Navas", "", Type:=8)
If TypeName(xTRg) = "Nothing" Then Exit Sub
Set xVRg = Application.InputBox("Please select the column you want to split data based on:", "Code by Ali Navas", "", Type:=8)
If TypeName(xVRg) = "Nothing" Then Exit Sub
vcol = xVRg.Column
Set ws = xTRg.Worksheet
lr = ws.Cells(ws.Rows.Count, vcol).End(xlUp).Row
title = xTRg.AddressLocal
titlerow = xTRg.Cells(1).Row
icol = ws.Columns.Count
ws.Cells(1, icol) = "Unique"
Application.DisplayAlerts = False
If Not Evaluate("=ISREF('xTRgWs_Sheet!A1')") Then
Sheets.Add(After:=Worksheets(Worksheets.Count)).Name = "xTRgWs_Sheet"
Else
Sheets("xTRgWs_Sheet").Delete
Sheets.Add(After:=Worksheets(Worksheets.Count)).Name = "xTRgWs_Sheet"
End If
Set xWSTRg = Sheets("xTRgWs_Sheet")
xTRg.Copy
xWSTRg.Paste Destination:=xWSTRg.Range("A1")
ws.Activate
For i = (titlerow + xTRg.Rows.Count) To lr
On Error Resume Next
If ws.Cells(i, vcol) <> "" And Application.WorksheetFunction.Match(ws.Cells(i, vcol), ws.Columns(icol), 0) = 0 Then
ws.Cells(ws.Rows.Count, icol).End(xlUp).Offset(1) = ws.Cells(i, vcol)
End If
Next
myarr = Application.WorksheetFunction.Transpose(ws.Columns(icol).SpecialCells(xlCellTypeConstants))
ws.Columns(icol).Clear
For i = 2 To UBound(myarr)
ws.Range(title).AutoFilter field:=vcol, Criteria1:=myarr(i) & ""
If Not Evaluate("=ISREF('" & myarr(i) & "'!A1)") Then
Sheets.Add(After:=Worksheets(Worksheets.Count)).Name = myarr(i) & ""
Else
Sheets(myarr(i) & "").Move After:=Worksheets(Worksheets.Count)
End If
xWSTRg.Range(title).Copy
Sheets(myarr(i) & "").Paste Destination:=Sheets(myarr(i) & "").Range("A1")
ws.Range("A" & (titlerow + xTRg.Rows.Count) & ":A" & lr).EntireRow.Copy Sheets(myarr(i) & "").Range("A" & (titlerow + xTRg.Rows.Count))
Sheets(myarr(i) & "").Columns.AutoFit
Next
xWSTRg.Delete
ws.AutoFilterMode = False
ws.Activate
Application.DisplayAlerts = True
End Sub
=INT(YEARFRAC("Date of Birth",TODAY())
Use alphabets as serial:
=LEFT(ADDRESS(1, ROW(A1), 4, TRUE), (ROW(A1)>26)+1)
Find start date from a schedule(Array):
=ADDRESS(ROW(),MIN(IF(E2:BC2<>"",COLUMN(E2:BC2))),4,1)
Find end date from a schedule(Array):
=ADDRESS(ROW(),MAX((E2:BC2<>"")*COLUMN(E2:BC2)),4,1)
Convert cell name to column name:(Highlighted stands for the cell inquestion)
=IF(ISERROR(INT(MID(BD2,2,1))),LEFT(BD2,2),LEFT(BD2,1))
Ghant Chart in Excel(Conditional formatiing)
=AND(D$1>=$B2,D$1<=$C2)
D1=Start Month(Series)
B2=Start Date
C2=End date
Applies to range =$D$2:$P$200
Shortcuts are good. They save your time. These are some useful shortcuts for Microsoft Excel
1. Navigate Inside Worksheets
Arrow Keys
Move one cell up, down, left, or right in a worksheet.
Page Down/Page Up
Move one screen down / one screen up in a worksheet.
Alt+Page Down/Alt+Page Up
Move one screen to the right / to the left in a worksheet.
Tab/Shift+Tab
Move one cell to the right / to the left in a worksheet.
Ctrl+Arrow Keys
Move to the edge of next data region (cells that contains data)
Home
Move to the beginning of a row in a worksheet.
Ctrl+Home
Move to the beginning of a worksheet.
Ctrl+End
Move to the last cell with content on a worksheet.
Ctrl+f
Display the Find and Replace dialog box (with Find selected).
Ctrl+h
Display the Find and Replace dialog box (with Replace selected).
Shift+F4
Repeat last find.
Ctrl+g (or f5)
Display the 'Go To' dialog box.
Ctrl+Arrow Left/Ctrl+Arrow Right
Inside a cell: Move one word to the left / to the right.
Home/End
Inside a cell: Move to the beginning / to the end of a cell entry.
Alt+Arrow Down
Display the AutoComplete list e.g. in cell with dropdowns or autofilter.
End
Turn 'End' mode on. In End mode, press arrow keys to move to the next nonblank cell in the same column or row as the active cell. From here use arrow keys to move by blocks of data,home to move to last cell, or enter to move to the last cell to the right.
▲ up
2. Work with Data Selections
Select Cells
Shift+Space
Select the entire row.
Ctrl+Space
Select the entire column.
Ctrl+Shift+* (asterisk)
Select the current region around the active cell.
Ctrl+a (or ctrl+Shift+spacebar)
Select the entire worksheet or the data-containing area. Pressing ctrl+a a second time then selects entire worksheet.
Ctrl+Shift+Page Up
Select the current and previous sheet in a workbook.
Ctrl+Shift+o
Select all cells with comments.
Shift+Arrow Keys
Extend the selection by one cell.
Ctrl+Shift+Arrow Key
Extend the selection to the last cell with content in row or column.
Shift+Page Down/Shift+Page Up
Extend the selection down one screen /up one screen.
Shift+Home
Extend the selection to the beginning of the row.
Ctrl+Shift+Home
Extend the selection to the beginning of the worksheet.
Ctrl+Shift+End
Extend the selection to the last used cell on the worksheet (lower-right corner).
Manage Active Selections
F8
Turn on extension of selection with arrow keys without having to keep pressing shift.
Shift+F8
Add another (adjacent or non-adjacent) range of cells to the selection. Usearrow keys andshift+arrow keysto add to selection.
Shift+Backspace
Select only the active cell when multiple cells are selected.
Ctrl+Backspace
Show active cell within selection.
Ctrl+. (period)
Move clockwise to the next corner of the selection.
Enter/Shift+Enter
Move active cell down / up in a selection.
Tab/Shift+Tab
Move active cell right / left in a selection.
Ctrl+Alt+Arrow Right/Ctrl+Alt+Arrow Left
Move to the right / to the left between non-adjacent selections (with multiple ranges selected).
Esc
Cancel Selection.
Select inside cells
Shift+Arrow Left/Shift+Arrow Right
Select or unselect one character to the left / to the right.
Ctrl+Shift+Arrow Left/Ctrl+Shift+Arrow Right
Select or unselect one word to the left / to the right.
Shift+Home/Shift+End
Select from the insertion point to the beginning / to the end of the cell.
▲ up
3. Insert and Edit Data
Undo / Redo Shortcuts
Ctrl+z
Undo last action (multiple levels).
Ctrl+y
Redo last action (multiple levels).
Work with Clipboard
Ctrl+c
Copy contents of selected cells.
Ctrl+x
Cut contents of selected cells.
Ctrl+v
Paste content from clipboard into selected cell.
Ctrl+Alt+v
If data exists in clipboard: Display the Paste Special dialog box.
Ctrl+Shift+[+]
If data exists in clipboard: Display the Insert dialog box to insert blank cells.
Edit Inside Cells
F2
Edit the active cell with cursor at end of the line.
Alt+Enter
Start a new line in the same cell.
Enter
Complete a cell entry and move down in the selection. With multiple cells selected: fill cell range with current cell.
Shift+Enter
Complete a cell entry and move up in the selection.
Tab/Shift+Tab
Complete a cell entry and move to the right / to the left in the selection.
Esc
Cancel a cell entry.
Backspace
Delete the character to the left of the insertion point, or delete the selection.
Delete
Delete the character to the right of the insertion point, or delete the selection.
Ctrl+Delete
Delete text to the end of the line.
Ctrl+; (semicolon)
Insert current date.
Ctrl+Shift+:(colon)
Insert current time.
Ctrl+t
Show all content as standard numbers. (So 14:15 becomes 14.25 etc for the entire file) To undo press ctrl + t again
Edit Active or Selected Cells
Ctrl+d
Fill complete cell down (Copy above cell).
Ctrl+r
Fill complete cell to the right (Copy cell from the left).
Ctrl+"
Fill cell values down and edit (Copy above cell values).
Ctrl+' (apostrophe)
Fill cell formulas down and edit (Copy above cell formulas).
Ctrl+l
Insert a table (display Create Table dialog box).
Ctrl+-
Delete Cell/Row/Column Menu
Ctrl+- with row / column selected
Delete row / delete column.
Ctrl+Shift++
Insert Cell/Row/Column Menu
Ctrl+Shift++ with row / column selected
Insert row/ insert column.
Shift+F2
Insert / Edit a cell comment.
Shift+f10, then m
Delete comment.
Alt+F1
Create and insert chart with data in current range as embedded Chart Object.
F11
Create and insert chart with data in current range in a separate Chart sheet.
Ctrl+k
Insert a hyperlink.
enter (in a cell with a hyperlink)
Activate a hyperlink.
Hide and Show Elements
Ctrl+9
Hide the selected rows.
Ctrl+Shift+9
Unhide any hidden rows within the selection.
Ctrl+0 (zero)
Hide the selected columns.
Ctrl+Shift+0 (zero)
Unhide any hidden columns within the selection*.
Ctrl+` (grave accent)
Alternate between displaying cell values and displaying cell formulas. Accent grave /not a quotation mark.
Alt+Shift+Arrow Right
Group rows or columns.
Alt+Shift+Arrow Left
Ungroup rows or columns.
Ctrl+6
Alternate between hiding and displaying objects.
Ctrl+8
Display or hides the outline symbols.
Ctrl+6
Alternate between hiding objects, displaying objects, and displaying placeholders for objects.
*Does not seem to work anymore in Excel 2010. Detailed explanation here: http://superuser.com/questions/183197/whats-the-keyboard-shortcut-to-unhide-a-column-in-excel-2010 why.
Adjust Column Width and Row Height
Note: there are no default shortcuts for this, but workaround through access keys from previous versions
Alt+o, ca
Adjust Column width to fit content. Select complete column with Ctrl+Space first, otherwise column adjusts to content of current cell). Remember Format, ColumnAdjust.
Alt+o, cw
Adjust Columns width to specific value:Option, Cow, width
Alt+o, ra
Adjust Row height to fit content: Option,Row, Adjust
Alt+o, re
Adjust Row height to specific value:Option, Row, Height
▲ up
4. Format Data
Format Cells
Ctrl+1
Format cells dialog.
Ctrl+b (orctrl+2)
Apply or remove bold formatting.
Ctrl+i (or ctrl+3)
Apply or remove italic formatting.
Ctrl+u (or ctrl+4)
Apply or remove an underline.
Ctrl+5
Apply or remove strikethrough formatting.
Ctrl+Shift+f
Display the Format Cells with Fonts Tab active. Press tab 3x to get to font-size. Used to be ctrl+shift+p, but that seems just get to the Font Tab in 2010.
Alt+' (apostrophe / single quote)
Display the Style dialog box.
Number Formats
Ctrl+Shift+$
Apply the Currency format with two decimal places.
Ctrl+Shift+~
Apply the General number format.
Ctrl+Shift+%
Apply the Percentage format with no decimal places.
Ctrl+Shift+#
Apply the Date format with the day, month, and year.
Ctrl+Shift+@
Apply the Time format with the hour and minute, and indicate A.M. or P.M.
Ctrl+Shift+!
Apply the Number format with two decimal places, thousands separator, and minus sign (-) for negative values.
Ctrl+Shift+^
Apply the Scientific number format with two decimal places.
F4
Repeat last formatting action: Apply previously applied Cell Formatting to a different Cell
Apply Borders to Cells
Ctrl+Shift+&
Apply outline border from cell or selection
Ctrl+Shift+_ (underscore)
Remove outline borders from cell or selection
Ctrl+1, thenCtrl+Arrow Right/Arrow Left
Access border menu in 'Format Cell' dialog. Once border was selected, it will show up directly on the next Ctrl+1
Alt+t*
Set top border
Alt+b*
Set bottom Border
Alt+l*
Set left Border
Alt+r*
Set right Border
Alt+d*
Set diagonal and down border
Alt+u*
Set diagonal and up border
*In Cell Format in 'Border' Dialog Window
Align Cells
Alt+h, ar
Align Right
Alt+h, ac
Align Center
Alt+h, al
Align Left
▲ up
5. Formulas and Names
Formulas
=
Start a formula.
Alt+=
Insert the AutoSum formula.
Shift+F3
Display the Insert Function dialog box.
Ctrl+a
Display Formula Window after typing formula name.
Ctrl+Shift+a
Insert Arguments in formula after typing formula name. .
Shift+F3
Insert a function into a formula .
Ctrl+Shift+Enter
Enter a formula as an array formula.
F4
After typing cell reference (e.g. =E3) makes reference absolute (=$E$4)
F9
Calculate all worksheets in all open workbooks.
Shift+F9
Calculate the active worksheet.
Ctrl+Alt+F9
Calculate all worksheets in all open workbooks, regardless of whether they have changed since the last calculation.
Ctrl+Alt+Shift+F9
Recheck dependent formulas, and then calculates all cells in all open workbooks, including cells not marked as needing to be calculated.
Ctrl+Shift+u
Toggle expand or collapse formula bar.
Ctrl+`
Toggle Show formula in cell instead of values
Names
Ctrl+F3
Define a name or dialog.
Ctrl+Shift+F3
Create names from row and column labels.
F3
Paste a defined name into a formula.
▲ up
6. Manage Multipe Worksheets
Shortcuts to delete, rename, or move worksheets are based on the old Excel 2003 menus which still work in Excel 2010.
Shift+F11/Alt+Shift+F1
Insert a new worksheet in current workbook.
Ctrl+Page Down/Ctrl+Page Up
Move to the next / previous worksheet in current workbook.
Shift+Ctrl+Page Down/Shift+Ctrl+Page Up
Select the current and next sheet(s) / select and previous sheet(s).
Alt+o then h r
Rename current worksheet (format, sheet,rename)
Alt+e then l
Delete current worksheet (Edit, delete)
Alt+e then m
Move current worksheet (Edit, move)
▲ up
7. Manage Multiple Workbooks
F6/Shift+F6
Move to the next pane / previous pane in a workbook that has been split.
Ctrl+F4
Close the selected workbook window.
Ctrl+n
Create a new blank workbook (Excel File)
Ctrl+Tab/Ctrl+Shift+Tab
Move to next / previous workbook window.
Alt+Space
Display the Control menu for Main Excel window.
Ctrl+F9
Minimize current workbook window to an icon. Also restores ('un-maximizes') all workbook windows.
Ctrl+F10
Maximize or restores the selected workbook window.
Ctrl+F7
Move Workbook Windows which are not maximized.
Ctrl+F8
Perform size command for workbook windows which are not maximzed.
Alt+F4
Close Excel.
▲ up
8. Various Excel Features
Ctrl+o
Open File.
Ctrl+s
Save the active file with its current file name, location, and file format.
F12
Display the Save As dialog box.
f10 (or alt)
Turn key tips on or off.
Ctrl+p
Print File (Opens print menu).
F1
Display the Excel Help task pane.
F7
Display the Spelling dialog box.
Shift+F7
Display the Thesaurus dialog box.
Alt+F8
Display the Macro dialog box.
Alt+F11
Open the Visual Basic Editor to create Macros.
▲ up
9. Work with the Excel Ribbon
Ctrl+F1
Minimize or restore the Ribbon.s
Alt/F10
Select the active tab of the Ribbon and activate the access keys. Press either of these keys again to move back to the document and cancel the access keys. and thenarrow left or arrow right
Shift+F10
Display the shortcut menu for the selected command.
Space/Enter
Activate the selected command or control in the Ribbon, Open the selected menu or gallery in the Ribbon..
Enter
Finish modifying a value in a control in the Ribbon, and move focus back to the document.
F1
Get help on the selected command or control in the Ribbon. (If no Help topic is associated with the selected command, the Help table of contents for that program is shown instead.)
▲ up
10. Data Forms
Tab/Shift+Tab
Move to the next / previous field which can be edited.
Enter/Shift+Enter
Move to the first field in the next / previous record.
Page Down/Page Up
Move to the same field 10 records forward / back.
Ctrl+Page Down
Move to a new record.
Ctrl+Page Up
Move to the first record.
Home/End
Move to the beginning / end of a field.
▲ up
11. Pivot Tables
Arrow Keys
Navigate inside Pivot tables.
Home/End
Select the first / last visible item in the list.
Alt+c
Move the selected field into the Column area.
Alt+d
Move the selected field into the Data area.
Alt+l
Display the PivotTable Field dialog box.
Alt+p
Move the selected field into the Page area.
Alt+r
Move the selected field into the Row area.
Ctrl+Shift+* (asterisk)
Select the entire PivotTable report.
arrow keys to select the cell that contains the field, and thenalt+Arrow Down
Display the list for the current field in a PivotTable report.
arrow keys to select the page field in a PivotChart report, and thenalt+Arrow Down
Display the list for the current page field in a PivotChart report.
Enter
Display the selected item.
Space
Select or clear a check box in the list.
Ctrl+tabctrl+Shift+Tab
select the PivotTable toolbar.
enter then arrow down/Arrow Up
On a field button: select the area you want to move the selected field to.
Alt+Shift+Arrow Right
Group selected PivotTable items.
Alt+Shift+Arrow Left
Ungroup selected PivotTable items.
▲ up
12. The Rest
Dialog Boxes
Arrow Keys
Move between options in the active drop-down list box or between some options in a group of options.
Ctrl+Tab/Ctrl+Shift+Tab
Switch to the next/ previous tab in dialog box.
Space
In a dialog box: perform the action for the selected button, or select/clear a check box.
Tab/Shift+Tab
Move to the next / previous option.
a ... z
Move to an option in a drop-down list box starting with the letter
Alt+a ... alt+z
Select an option, or select or clear a check box.
Alt+Arrow Down
Open the selected drop-down list box.
Enter
Perform the action assigned to the default command button in the dialog box.
Esc
Cancel the command and close the dialog box.
Auto Filter
Alt+Arrow Down
On the field with column head, display the AutoFilter list for the current column .
Arrow Down/Arrow Up
Select the next item / previous item in the AutoFilter list.
Alt+Arrow Up
Close the AutoFilter list for the current column.
Home/End
Select the first item / last item in the AutoFilter list.
Enter
Filter the list by using the selected item in the AutoFilter list.
Ctrl + Shift + L
Apply filter on selected column headings.
Work with Smart Art Graphics
Arrow Keys
Select elements.
Esc
Remove Focus from Selection.
F2
Edit Selection Text in if possible (in formula bar).
http://www.myonlinetraininghub.com/
Excel Formulae
Remove zeros from Excel
0;-0;;@
Convert Date to month:
=DATE(YEAR(A2),MONTH(A2),1)
Find Job Location:
=IF((D2="VACATION"),IF(F2<>"VACATION",F2,IF(H2<>"VACATION",H2,J2)),IF(D2="",F2,D2))
Roundup date to Next month:
=IF(AND(DAY(A2)>=1,DAY(A2)<25),DATE(YEAR(A2),MONTH(A2),1),DATE(YEAR(A2),MONTH(A2)+1,1))
where A2=Date to be rounded up to next month
Number 25 could be changed to the desired roundup days
Find if Duplicates:
=countif(a:a,a2)>1
Count number of Duplicates occurances(index):
=countif(a$2$:a2,a2)
Count Duplicates:
=countif(a:a,a2)
Show the last saved date:
VBA Code
Sub getChangeInfo()
Dim lastAuth, lastSave
lastSave = ActiveWorkbook.BuiltinDocumentProperties(12)
ActiveSheet.Range("A1") = "Last Saved: " & lastSave
End Sub
Save sheets sepertely from Excel Book:
VBA Code
Sub CreateWorkbooks()
Dim wbDest As Workbook
Dim wbSource As Workbook
Dim sht As Object
Dim strSavePath As String
On Error GoTo ErrorHandler
Application.ScreenUpdating = False
strSavePath = "C:\Temp\"
Set wbSource = ActiveWorkbook
For Each sht In wbSource.Sheets
sht.Copy
Set wbDest = ActiveWorkbook
wbDest.SaveAs strSavePath & sht.Name
wbDest.Close
Next
Application.ScreenUpdating = True
Exit Sub
ErrorHandler:
MsgBox "An error has occurred. Error number=" & Err.Number & ". Error description=" & Err.Description & "."
End Sub