Basic data manipulation in Excel
- Identify duplicate records.
- Remove duplicate records.
- Manipulate database columns to match a target format.
- Populate blank data quality codes.
- Split up one field into several fields.
- Check for a middle initial.
- Strip out undesirable characters.
- Combine data elements that are stored across multiple columns into one column.
Contents
- 1 How do you manipulate data?
- 2 What is cell manipulation in Excel?
- 3 What is data manipulation tool?
- 4 How do you manipulate rows and columns in Excel?
- 5 How do you manipulate a cell?
- 6 How do you manipulate columns in Excel?
- 7 Which one is manipulated of data?
- 8 How do I massage data in Excel?
- 9 What is referencing in Excel?
- 10 What is editing worksheet?
- 11 How do I change the size of a cell in Excel?
- 12 What is the shortcut key to edit a cell in Excel?
- 13 How do you modify the chart so the owner draw data series?
- 14 How do I make Excel cells expand to fit text?
- 15 How do I edit a spreadsheet?
- 16 What is data manipulation in ML?
- 17 How do I clean up messy data in Excel?
- 18 How do you massage data?
- 19 What are the 3 types of cell references in Excel?
- 20 How does a Vlookup work?
Steps to Manipulate Data
- To begin, you’ll need a database, which is created from your data sources.
- You then need to cleanse your data, with data manipulation, you can clean, rearrange and restructure data.
- Next, import and build a database that you will work from.
- You can combine, merge and delete information.
What is cell manipulation in Excel?
Manipulation of cells is entering and modifying the contents of the cells.
What is data manipulation tool?
Data manipulation tools allow you to modify data to make it easier to read or organize. These tools help identify patterns in your data that may otherwise not be obvious. For instance, you can arrange a data log in alphabetical order using a data manipulation tool so that discrete entries are easier to find.
How do you manipulate rows and columns in Excel?
To modify all rows or columns:
- Locate and click the Select All button just below the name box to select every cell in the worksheet.
- Position the mouse over a row line so the cursor becomes a double arrow.
- Click and drag the mouse to increase or decrease the row height, then release the mouse when you are satisfied.
How do you manipulate a cell?
Optical manipulation of cells is enabled by a technique called optical trapping. This technique enables trapping of cells using a system consisting of a microscope with a high numerical aperture objective lens and a highly-focused laser beam, which exerts optical forces on cells or particles.
How do you manipulate columns in Excel?
Basic Manipulation
- Inserting/Adding Columns – Simply select the column to the right of the column you wish to add, right click, and select “Insert”
- Deleting Columns – This process can be handled simply by selecting the column that is not needed, right clicking and selecting “Delete”
Which one is manipulated of data?
The DML is used to manipulate data, which is a programming language. It short for Data Manipulation Language that helps to modify data like adding, removing, and altering databases. It means that changing the information in a way that can be read easily.
How do I massage data in Excel?
Step 2: Formatting SSN
- Select the range A2:A10 where the data is stored.
- Bring up the Format Cells dialog (CTRL + 1)
- On the Number tab, click on the Custom category.
- In the Type field, enter this string: 000-00-0000.
- Click OK.
What is referencing in Excel?
In Microsoft Excel, cell referencing is the method by which you refer to a cell or series of cells in a formula. Cell referencing is not important unless you plan to copy the formula to a number of other cells.
What is editing worksheet?
You edit a worksheet to change the way that the worksheet looks or behaves. For example, you might want to change the layout of worksheet data, or add calculations, percentages, or totals.Choose Edit | Worksheet… to display the “Edit Worksheet dialog”.
How do I change the size of a cell in Excel?
Set a column to a specific width
- Select the column or columns that you want to change.
- On the Home tab, in the Cells group, click Format.
- Under Cell Size, click Column Width.
- In the Column width box, type the value that you want.
- Click OK.
What is the shortcut key to edit a cell in Excel?
F2
First, the keyboard shortcut for editing a cell is F2 on Windows, and Control + U on a Mac. With Excel’s default settings, this will put your cursor directly in the cell, ready to edit.
How do you modify the chart so the owner draw data series?
Modify the chart so the Owner Draw data series is plotted along the.. On the Charts Tools Design tab, in the Type group, click the Change Chart Type button. IN the Change Chart Type dialog, click the Secondary Axis check box next to the Owner Draw series. Insert a sunburst chart based on the selected cells.
How do I make Excel cells expand to fit text?
Select the excel cell that you want to expand to fit the text size. Click Home —> Format —> AutoFit Row Height / AutoFit Column Width menu item to expand it.
How do I edit a spreadsheet?
Edit data in a cell
- Open a spreadsheet in the Google Sheets app.
- In your spreadsheet, double-tap the cell you want to edit.
- Enter your data.
- Optional: To format text, touch and hold the text, then choose an option.
- When done, tap Done .
What is data manipulation in ML?
Data Manipulation Meaning: Manipulation of data is the process of manipulating or changing information to make it more organized and readable.
How do I clean up messy data in Excel?
Here’s a list of Top 10 Super Neat Ways to Clean Data in Excel as follows.
- Get Rid of Extra Spaces:
- Select & Treat all blank cells:
- Convert Numbers Stored as Text into Numbers:
- Remove Duplicates:
- Highlight Errors:
- Change Text to Lower/Upper/Proper Case:
- Parse Data Using Text to Column:
How do you massage data?
Data Massaging Best Practices
- Create a Data Quality Plan. The first step is to set clear expectations for your data and to create data quality KPIs based on specific business rules.
- Structure Data at the Entry Point.
- Validate Data Accuracy.
- Remove Duplicates.
- Append Data.
What are the 3 types of cell references in Excel?
Relative, Absolute and Mixed
A key element of a formula is the cell reference, and there are three types: Relative. Absolute. Mixed.
How does a Vlookup work?
The VLOOKUP function performs a vertical lookup by searching for a value in the first column of a table and returning the value in the same row in the index_number position. The VLOOKUP function is a built-in function in Excel that is categorized as a Lookup/Reference Function.
February 26, 2020
4.9K views
Learning techniques in Excel data manipulation can save time and lessen your stress at work. If you are one of those people who wish to enhance their skills in Excel, then you are in the right place.
In this article, you will learn some beneficial tips in manipulating data in your spreadsheet. Whether you are a business owner, freelancer, or an employee, these tips can make your life easier if you take time to learn it. Continue reading and check out the following tips.
Helpful Tools in Data Manipulation
Basic Tools
- Freezing Panes
Excel’s freezing panes allows you to lock specific rows so you can still see them even when you are scrolling. It works both for columns and rows.
You must take note that under the Freezing Panes command, you can choose the “Freeze First Column” or “Freeze Top Row” if you want to keep the leftmost column/row visible when you scroll. Aside from allowing you to compare different columns or rows in a long spreadsheet, the Freezing Panes command also keeps the essential details in view.
How to Freeze Rows or Columns in Excel?
Step 1. Select the row below the row or rows that you want to keep visible. If you prefer to freeze columns, you must select the cell to the right of the column that you want to freeze.
Step 2. Go to the View tab.
Step 3. Select the Freeze Pane dropdown and choose “Freeze Panes.”
You can use this video as your guide in freezing your row or column:
Sorting Data
Sorting your data helps you to reorganize your spreadsheet quickly. For instance, you can sort your list of products by its suppliers. You can also sort it numerically, alphabetically, and in many other ways.
Before sorting the data, you must first decide if you want to sort the entire spreadsheet or just a particular column.
Sort sheet
Sort sheet allows you to organize all of your data based on one column. Related information across each row is remained after the sortation. It is the best one for you if you want to arrange your data alphabetically or alphanumerically.
Sort range
Sort range is ideal for a sheet with several tables. It sorts the data in a variety of cells without affecting the other content on the worksheet.
How to sort a sheet?
Step 1. Select the cell in the column that you want to sort.
Step 2. Click the data table, choose the Sort 7 Filter group, and do the following:
To sort in ascending order, click the A-Z button
To sort in descending order, click the Z-A button in descending order.
You must not forget to check if all data is sorted as text. If you want to sort a column that contains numbers, you can format them either number or text. You can choose your sorting option in the Format Cells dialog, click the Category dropdown and select your preferred sorting option.
You can use this video as your guide in sorting your data:
Function Tools
Here are some of the essential functions or formulas in manipulating data.
IF Statements
If statements are useful for several situations. It can save your time and output a text if a particular data is valid or false. For instance, you can write the function =IF(A1>A2, “EXCELLENT”, “FAIL”), where A1>A2 is the case, “EXCELLENT” is the output if true and “FAIL” is the output if false.
SUMIF, COUNTIF, AVERAGEIF
All of these functions or formulas are structured like =FUNCTION(range, criteria, function range). So in SUM, you can put =SUM(A1:A10, “EXCELLENT”, B1:B10). This function will automatically add the values of B1 to B10 if the total sum of A1 to A10 has an output of “EXCELLENT”. You may be starting to think that these functions can make your complex spreadsheets easier.
MAX and MIN
These functions may be simple, but they are sure to help a lot when you have a massive amount of data. For example, you can put =MAX(A1:A10)if you want to get the maximum numerical value in those rows while you can use MIN to find the minimum.
AND
AND is one of the widely-used logical functions in Excel. It automatically checks if certain things are true or false. For instance, =AND(A1=”EXCELLENT”, B3>10) would output true if A1 is “EXCELLENT” and the value of B3 is greater than 10. You can add more value by simply adding another comma per value.
Other Excel functions that you must know:
FUNCTION | USE |
=Average(A1:A10) | Calculates the average of a set of data |
=Count(A1:A10) | Counts the number of cells in a range that contain numbers |
=CountA(A1:A10) | Counts the number of cells in a range that are not empty |
=Large(A1:A10,n) | Returns the nth largest value in a data set |
=Product(A1:A10) | Multiplies a range of data |
Auto Filter
AutoFilter is one of the effective ways to find your data faster. Excel has several filter options that you can use to subset the information on your spreadsheet
The categories are:
CATEGORY | USE |
Simple Numeric Conditions (Equals, Does Not Equal, Greater Than, etc.). | If you select one of these options, Excel will open up a dialog box in which you can specify up to two simple numeric conditions. |
Top 10… | Display rows containing the top N values. |
Above Average | Display numeric values that are above the average value. |
Below Average | Display numeric values that are below the average value. |
Custom Filter… | This opens up the same dialog box as you get when selecting the individual Numeric Conditions (Equals, Does Not Equal, etc.), to allow you to specify up to two numeric conditions. |
How to apply the AutoFilter?
Step 1. First, click the range of cells that you want to filter.
Step 2. Click the Data tab and select the Filter option
The dropdown menu will be visible on each of your header cells. It can be used to display specific rows for a particular category.
VLOOKUP Function
You can you VLOOKUP to search and retrieve data from a particular column in the table. It supports exact, approximate, and even wildcards. The letter “V” stands for “vertical”. It helps you to search through your data while basing on your unique identifier.
Here is an example of the VLOOKUP function:
What are the things to remember in using VLOOKUP?
- The VLOOKUP function can only search in the leftmost column of a table and returns a value from a column to the right. This function cannot look at its left. If you need to look for values from the left, you can use the INDEX MATCH combination since it does not care about lookup positions and return columns.
- The VLOOKUP function is case-insensitive. Therefore, both lowercase and uppercase characters are treated equally. If you want to distinguish data with case sensitivity, you can you the VLOOKUP case sensitive formulas.
- Remember the importance of TRUE and FALSE in the last parameter. You must use FALSE if you are looking for the exact match while TRUE for the approximate match.
Removing Duplicate Rows
Excel has an impressive job in removing duplicate in our spreadsheets. To clear all the copies, you can click the Data tab and choose the Remove Duplicates button. Leave all the checkboxes selected, so all copies are successfully removed.
9 Tools To Manipulate Data In Excel
Flash Fill And Remove Duplicates
If you deal with lots of data lists and find yourself doing a lot of cleaning and tiding up as well as having Microsoft Excel version 2013 or higher, then you will have this new feature called Flash Fill.
Prior to this version you will need to use the usual Text to Column feature found under the Data Tab. When you have data like an email address you may be needing to display only the surname. See “What Is Flash Fill In Excel” for examples.
With Microsoft Excel’s Flash Fill you can start the ball rolling by typing in the next column, for example the surname “Pisani” then fill the contents of the cell down. Initially the data should repeat. From the AutoFill Smart Tag that appears select Flash Fill this will start to pick up the surname from each row.
Microsoft Excel now has a feature called Remove Duplicates found under the Data Tab. Just take note the result of the duplicates does not get re located onto a separate sheet so once you press that button – Remove Duplicates, that’s it, you are left with the clean data.
In the past the alternative was to sort data then create an If Statement to test the first cell with the one below and return Yes or No, then filter all the yes’s and delete.
Sharing Excel Files
Sharing Excel Files using One Drive is very easy. One Drive is a Microsoft Office product that’s why it plays well with other Microsoft Office products like Excel.
One person can be in the file making a change and at the very same time another can be seeing the changes take place right before their eyes.
- Open the Excel File
- If you have version 2013 or 2016 you will have a share icon on the top right-hand corner
- Click the Share button
- Select Save to Cloud
- From the left-hand side Select OneDrive
- From the right navigate through your OneDrive folders
- Double Click the OneDrive folder to store it in
- Make sure you name your file then Press Save
Filtering Data
We can use Microsoft Excel when dealing with long lists. There are several techniques you can use to achieve this. One is to Go to the Data Tab and Select the Filter button the Second option is to activate from the Home tab and Select Filter.
Whilst the Filter tool is useful and will show you only the data that you are interested in. It also has the sort feature built into it under the Drop-down arrows.
Important to note is if you have blank rows and select a cell at the top, your filter will only capture data up until there was a blank row. What you should do first is select the first cell of your data, Press Ctrl Shift End then press the Data Tab and Select Filter.
The feature I love the most in the Filters is the Search Bar. Press the down arrow of any heading you will then see the Search Bar. If you have dates you can group quickly and easily by quarter, this quarter, last quarter. I find this so handing when importing my bank statements into Excel and then doing my book work.
Filter By and Sort By colour are both great tools to gather information for example everything yellow needs a post code, everything green is completed.
What Is Flash Fill?
An alternative to using Text to Column to extract the part that you need from a mix of data is the Flash Fill feature in Excel.
For example, if you have: analir.pisani@azsolutions.com.au you might want to extract each person’s surname.
Alternatively use Text to Column found under Data Tab.
- Type Pisani then fill down
- Click on the AutoFill Options Smart Tag
- Select Flash Fill only available since version 2013 forward
Split Data Into Separate Cells
When you need to split the data in Microsoft Excel from one column into several – use Text to Column. You can split the data each time there is a: space, comma, @, Tab and more. This feature has been available for many versions of Microsoft Excel.
Split a comments field which has Alt Enter text. Text in the same cell but on a new line. To Separate these use the Delimited option as the Other type:
Ctrl J. You will not see the letter J in the box but the action will work. Trust in the Force. 😉
What is new since Microsoft Excel Version 2013 is Flash Fill. Most of the time when people are using the Text to Column feature, they are not aware that they can skip columns. So, what they do is bring everything in and then start deleting columns when they could have done it in one place. Same goes for formatting the feature to format as date is in the Text to Column dialog box.
Here are the steps to separate data from on column into several columns.
Using Text To Column
-
- Select the column to split
- Ensure there is no data to the right
- Go to the Data Tab
- Select Text to Column
- If the data is separated by spaces, tabs, commas us the delimited options
- If the data has no notable separator use fixed
- If there is a column you do not wish to display
- Select “Do not import column(skip)”
Naming Excel Sheets
There are two techniques you can use when wanting to name your sheets in Microsoft Excel. You can Double Click on the name of the sheet, type the name and press Enter. You can also Right Mouse Click on the name of sheet and select from the list, Rename.
When working in Microsoft Excel you have a Workbook Name which means the name of the file. In just one sheet you have 16,000 columns and over 1 million rows.
English pages and pages worth of data in just 1 sheet. To navigate efficiently through all these sheets, you might like to Right Mouse Click on the arrows on the bottom left-hand corner. This will display a list of all the names of the sheets in your Microsoft Excel Workbook.
No, they do not appear in alphabetical order.
They appear in the order that you need to work with them. You can also Right Mouse Click on the Name of the sheet to change its tab colour, this can make it easier to find.
To make a copy of a sheet you can Right Mouse Click and select Move or Copy but it’s much easier if you hold the CTRL key as you drag. You should see a plus sign, this means it’s performing a copy.
YouTube Working with Sheets
This video will walk you through how to create a new sheet, rename it, copy a sheet and group sheets. The best thing about grouping sheets is that once they are grouped whatever you do in one cell will display in each of the other sheets. Imagine the formula or function was incorrect for each department sheet in cell A50. Group your sheets, make the change ungroup the sheets, that’s it they are all done all 20 different department sheets you had.
Navigating Multiple Sheets
If you find yourself working between multiple sheets you may find it frustrating to get quickly from one to the other. Pressing the navigation arrows on the bottom left will take for ever.
You could use shortcut keys Ctrl Page Up, Ctrl Page Down but this isn’t any faster.
Try the ultimate “Right Mouse Click” on the bottom left navigation arrows.
You will be presented with a list of all your sheets simply select one item in the list initially then press the first letter of the sheet name you would like to get to. If it didn’t get to the one you wanted, continue pressing the same letter. It will cycle through everything that starts with that letter.
Navigating Large Excel Spreadsheets Efficiently
Excel Spread sheets can be a pain to get around when you have lots of sheets to bounce around between and data that spans over many columns and rows.
Ctrl Home and Ctrl End should be the first keystrokes you ever learn because these can be used in not only Microsoft Excel Products but also in Word and PowerPoint. Ctrl Home will get you to the top and Ctrl End will get you to the very last page if in Word or the last column or row that has data in it for Excel.
I don’t know about you, but I found it stressful when I started a new job and I had to navigate someone else’s Excel spread sheets. I kept getting lost bouncing between the sheets that I needed to play with.
Sometimes I have coloured the sheets that are relevant to me. That worked.
Best Solution: Using the navigation arrows at the bottom left hand side. Right Mouse Click on them. This will produce a list of all the sheets in your workbook. Select the one you want, and press enter. It now takes you directly to that sheet. Stress solved. Ok one stress solved.
Selecting chunks of data is another drama. Click and drag for 100 years. Then I go past what I needed and fine it frustrating to go back. I’ve lost the plot by then.
If you have a block of data up to the point where there is a blank row or column. Ensure you have clicked inside that data set. This part of the step is crucial. Two keys and you’re done. CTRL A. Then you can continue to do whatever you like with this selected set. Copy and paste it, do some formatting or delete it.
Excel Shortcut Keys You Really Need To Know
If you change your mind and need to select the whole sheet you already pressed CTRL A when you were inside the data set press CTRL A, a second time and this will extend the selection to the entire Excel Sheet.
Saving your Excel spreadsheets as you go along is crucial. You can press the Save icon from the Quick Access Toolbar or you can save yourself a lot of time and press Ctrl S. Sometimes what you are after is not quite save but Save As, in that instance press F12.
We tend to work with multiple opened workbooks at a time and get slack at cleaning up after ourselves as we go by closing the files we don’t need. This is often why our machines struggle; they don’t have enough ram power to keep everything open. When you are ready to clear your Excel desk of opened files Hold the Shift key as you press the close cross at the top right-hand corner. This will close all your currently opened Excel Workbooks. Ctrl W will close only the current Excel Workbook.
If you are the kind of person that saves everything onto the Desktop, then getting to the Desktop when you are in an application can be done in several different ways. First you can close every Application window you have open until you can see the desktop. To the far right of your Windows Task Bar, where you can hardly see a command button area, you can click it and you will get to the Desktop. Are you ready for the ultimate keystroke Windows D?
Sure, it’s not hard to insert and Excel Worksheet you just press the plus sign all the way at the very end. When you press the plus sign, it inserts and Excel sheet to the right of the selected sheet. If you press Shift F11 you get the sheet inserted to the left of the selected sheet.
Ctrl Home you may already know will get you to cell A1.
When you work with extremely large Excel Worksheets that go into the double and the triple column letters. You will be looking for the quickest way you can find to get you to the very last column or row that has some data in it. Try, Ctrl End and Ctrl Shift End to Select and jump to the very end.
If creating graphs is something you need to do quite often. Well I’ve got one key for you. All you need is data with header labels and labels to the left then figures in each row. Ensure your cursor is in the data you don’t even have to have all the cells selected and then press F11. This will create a column graph for you.
Is data entry more your thing, are you typing the current date all the time perhaps for your time sheets. Don’t know about you but when I need to type todays date, I go looking at the bottom right-hand side of the Tabs bar. With this keystroke you will never look at the task bar or go for your phone to find the date. Press Ctrl ; and for the time press Ctrl Shift :
Pasting data is Ctrl V not Ctrl P. Ctrl P is for printing.
Insert Multiple Rows At A Time
Need to insert 5 to 10 rows above a certain point in your spreadsheet. I have seen people Right Click on ONE row and insert a row only to then repeat the process 5 times. There must be an easier way right. Yep there is.
Select 5 to 10 rows first then Right Mouse Click and select insert rows. Woo-Hoo done. Hope your feeling excited about how much time you can save. Want more.
This video will give you great insights into how to Navigate and Select using Microsoft Excel spread sheets.
To Double Click Or Not To Double Click
I often get asked by customers starting out using computers for the first time. Do I Click once or twice?
Good question.
One click is to select an item or a command.
Double click is generally used when you want to open something.
Let us look at the example of Excel.
When you are in a cell and you want to edit the contents of that cell, the standard is that you can double click. Then proceed to make what ever changes you would like followed by pressing Enter.
Recently I had installed an adding for Excel called Power-user. This is the only change that I could think of that I had made to Excel. So, I had thought this had caused the problem or setting to be turned off. Since then I went to double click in a cell as usual to make an edit. It wouldn’t put me in edit mode. This happened when I was in the middle of a class demonstrating.
I did all the usual steps that should fix the problem. I saved and exited the file. Re opened the file. Still the same problem.
A student of mine then said I turn of a feature in Excel, so it does not edit the cell but instead takes me to the link or cell it references to.
File/ Options/ Advanced. Untick “Allow editing directly in cells”
Sure, enough I went to File/ Options/ Advanced and it was unticked so odd. I certainly didn’t untick this feature.
It so happens that this is something that I actually have had students ask me.
Scenario: I have a cell with a link to data in a different sheet. For example =Finance!G20. I want to click on the cell that refers to another location and I also want to be able to come back.
With this feature turned on you can Double click on the cell to jump to for example Finance cell G20. Now to come back you will need to press F5 or the Go to command and it will show you the cell that it is referencing, select it and press enter.
Conclusions
Flash Fill is an alternative to using Text to Column. Often the simplest things are the most time saving like right mouse clicking on the bottom left hand corner of your Excel Spreadsheet to view a list of all your sheets, allowing you to quickly get to the specific Excel Spreadsheet you are after.
There are lots of wonderful shortcut keys to make your life easier when navigation around Microsoft Excel Spreadsheets. The top 5 most used Shortcut keys in Excel are: Ctrl S to Save, Ctrl W to close a window, Ctrl C to copy and Ctrl V to paste and Ctrl P for print.
AZ Solutions Pty Ltd also provided face to face Microsoft Office Computer Training Courses in Sydney – Sutherland Shire – Western Sydney – Parramatta – Wollongong.
Book a professional facilitator with over 24 years’ experience in their field.
Be sure to subscribe to our YouTube Channel – Analir Pisani. You will be empowered.
Microsoft Office Small Group Training Sessions
AZ Solutions delivers customized training courses in Sydney – Australia. We come to you. All you need is a board room, PC’s for each student and a TV/ Projector with a HDMI connection cable. Virtual Training sessional also available.
In our training sessions you are welcomed to bring examples of your work to class. We prefer it.
Call Now M 0414 417 059 visit www.azsolutions.com.au
Share This Story, Choose Your Platform!
Related Posts
Page load link
Go to Top
Microsoft Excel is a powerful tool that can be used for data manipulation. To make the most of the software, you need to use VBA. Visual Basic for Applications, or VBA, allows Excel users to create macros, which are powerful time-saving custom functions for data manipulation and analysis. Macros process VBA code to manage large data sets that would otherwise take a lot of time to modify.
VBA example script used in Excel
Sub ConfigureLogic() Dim qstEntries Dim dqstEntries Dim qstCnt, dqstCnt qstEntries = Range("QualifiedEntry").Count qst = qstEntries - WorksheetFunction.CountIf(Range("QualifiedEntry"), "") ReDim QualifiedEntryText(qst) 'MsgBox (qst) dqstEntries = Range("DisQualifiedEntry").Count dqst = dqstEntries - WorksheetFunction.CountIf(Range("DisQualifiedEntry"), "") ReDim DisqualifiedEntryText(dqst) 'MsgBox (dqst) For qstCnt = 1 To qst QualifiedEntryText(qstCnt) = ThisWorkbook.Worksheets("Qualifiers").Range("J" & 8 + qstCnt).value 'MsgBox (QualifiedEntryText(qstCnt)) logging ("Configured Qualified Entry entry #" & qstCnt & " as {" & QualifiedEntryText(qstCnt) & "}") Next For dqstCnt = 1 To dqst DisqualifiedEntryText(dqstCnt) = ThisWorkbook.Worksheets("Qualifiers").Range("M" & 8 + dqstCnt).value 'MsgBox (DisqualifiedEntryText(dqstCnt)) logging ("Configured DisQualified Entry entry #" & qstCnt & " as {" & DisqualifiedEntryText(dqstCnt) & "}") Next includeEntry = ThisWorkbook.Worksheets("Qualifiers").Range("IncludeSibling").value 'MsgBox (includeEntry) logging ("Entrys included in search - " & includeEntry) End Sub
How to analyze and manipulate entries in a spreadsheet?
To use VBA for data analysis, you will need to check the settings in Excel for the Developer tool. To find it, locate the Excel Ribbon and search for the Developer tab. You will need to activate it in the Excel Settings menu if it is not displayed.
Next, create a new worksheet and name it «Qualifiers.» We will use this sheet to check for everything that qualify the selections.
Next, set up the qualifiers on the sheet according to the code. It must be entered manually; cut and paste will not work.
ThisWorkbook.Worksheets("Qualifiers").Range("J" & 8 + qstCnt).value
How to locate the range and construct an array?
The range in the function above is cell J9. The range function notes an 8; however, the actual range is 9 because:
For qstCnt = 1 To qst
The above statement starts at 1, not 0. Therefore, the list starts at 9. In this case, note (qstCnt=1).
To construct an array out of entries on the Qualifiers worksheet, place random words in cells J9-J13. Once the rows are completed, we can move forward with finding and manipulating data in Excel.
Private Sub CountSheets() Dim sheetcount Dim WS As Worksheet sheetcount = 0 logging ("*****Starting Scrub*********") For Each WS In ThisWorkbook.Worksheets sheetcount = sheetcount + 1 If WS.Name = "Selected" Then 'need to log the date and time into sheet named "Logging" ActionCnt = ActionCnt + 1 logging ("Calling sheet: " & WS.Name) scrubsheet (sheetcount) Else ActionCnt = ActionCnt + 1 logging ("Skipped over sheet: " & WS.Name) End If Next WS 'MsgBox ("ending") ActionCnt = ActionCnt + 1 logging ("****Scrub DONE!") Application.ScreenUpdating = True End Sub
There is an example of a working tab counter.
Dim sheetcount Dim WS As Worksheet sheetcount = 0 logging ("*****Starting Scrub*********") For Each WS In ThisWorkbook.Worksheets sheetcount = sheetcount + 1
After initialising the sheet count, set it to 0 in order to restart the counter.
Logging() is another subroutine that keeps track of all actions in order to audit selections.
The next For loop sets up the Active Workbook for counting. WS is the initialised and ThisWorkbook. Worksheets is the active tab in the book. Since we have not named the workbook, this module will run on any active workbook. If you are working on multiple workbooks and have the wrong one activated, it will attempt to run on it. To avoid errors, take precautions to name your specific workbook or only work on one at a time.
Every time the loop fires, it adds one variable to the sheet count to keep track of the number of tabs. Then we move to:
If WS.Name = "Selected" Then 'need to log the date and time into sheet named "Logging" ActionCnt = ActionCnt + 1 logging ("Calling sheet: " & WS.Name) scrubsheet (sheetcount) Else ActionCnt = ActionCnt + 1 logging ("Skipped over sheet: " & WS.Name) End If
Here, we look for the Selected tab.
If the variable WS equals Selected, we log it and fire the subroutine Scrub Sheet. If the variable WS is not equal to Selected, it is logged that that sheet was skipped and the action is counted. The above code is an example of how to count the number of and locate a particular tab.
The following list is all of the different methods that can be used to manipulate data!
Have FUN!
How to count the number of sheets in a workbook?
Dim TAB For Each TAB In ThisWorkbook.Worksheets 'some routine here next
How to find the last row, column, or cell on a worksheet?
Dim cellcount cellcount = Cells(ThisWorkbook.Worksheets("worksheet").Rows.Count, 1).End(xlUp).Row
How to filter by using advanced criteria?
Range("A2:Z99").Sort key1:=Range("A5"), order1:=xlAscending, Header:=xlNo
How to apply auto-fit property to a column?
Columns("A:A").EntireColumn.AutoFit
How to get values from another worksheet?
dim newvalue newvalue = ThisWorkbook.Worksheets("worksheet").Range("F1").value
How to insert a column into a worksheet?
Dim Row, Column Cells(Row, Column).EntireColumn.Select Selection.Insert
How to insert multiple columns into a worksheet?
Dim insertCnt Dim Row, Column For insertCnt = 1 To N ThisWorkbook.Worksheets("worksheet").Select Cells(Row, Column).EntireColumn.Select Selection.Insert Next
How to add a named range to a particular sheet?
ThisWorkbook.Worksheets("worksheet").Names.Add Name:="Status", RefersToR1C1:="=worksheet!C2"
How to insert an entire row into a worksheet?
Dim Row, Column Cells(Row, Column).EntireRow.Select Selection.Insert
How to copy an entire row for pasting?
ActiveSheet.Range("A1").EntireRow.Select Selection.Copy
How to delete an entire row?
ActiveSheet.Range("A1").EntireRow.Select Selection.Delete
How to select a particular sheet?
ThisWorkbook.Worksheets("worksheet").Select
How to compare values of a range?
Dim firstrange Dim Logictest Logictest = "some word or value" If (Range(firstrange).value = Logictest) then 'some routine here End If
Any more excel questions? Check out our forum!
There’s plenty you can do, if you know the correct formulas.
Executive Editor, Data & Analytics,
Computerworld |
Thinkstock
If you work with data much, you don’t need a statistical model to predict that the odds of consistently getting data in the format you need for analysis are pretty low. Those who do a great deal of data cleaning and reformatting often turn to scripting languages like Python or specialty tools such as OpenRefine or .
But it turns out that there’s a lot of data munging you can do in a plain old Excel spreadsheet — if you know how to craft the proper formulas.
In a presentation at the recent 2014 Computer Assisted Reporting (CAR) conference, MaryJo Webster, senior data reporter with Digital First Media — a newspaper group in New York — shared some of her favorite Excel tricks. The goal of these tips, Webster said: Learn at least one new thing that will make you say, «Why didn’t I know this before?»
Date functions
Tip 1: Split dates into separate fields
You can extract the year, month and day into separate fields from a date field in Excel by using formulas =Year(CellWithDate), =MONTH(CellWithDate) and =DAY(CellWithDate). Splitting dates this way — by year, month and day of month — works in Access as well, Webster said.
In addition, you can also get the day of the week for any date in Excel with =WEEKDAY(CellWithDate). The default returns numbers, not names of the days of week, with 1 for Sunday, 2 for Monday and so on.
To display the name of the weekday instead of a number, apply a custom format to the cells with the weekday numbers, using Format cells > Custom; then type ddd in the Type text box to get three-day abbreviations or dddd for the full day name.
Tip 2: Find someone’s current age
If you have someone’s date of birth, you can find his or her current age on whatever day you open the spreadsheet with the =DATEDIF() and =TODAY() functions. TODAY(), as you might guess, gives the current date. DATEDIF() gives the difference between two dates in units of years («y»), months («m») or days («d»), using the syntax:
=DATEDIF(Date1, Date2, Unit of measure)
So, to get current age in years, use the formula:
=DATEDIF(CellWithBirthday,TODAY(), "y")
Note that the years unit returns ages in whole numbers and does not round up.
See an example below.
If you have someone’s date of birth, you can find his or her current age.