Der Beitrag Metadata in Excel: 6 Methods of How to See and Remove All MetaData erschien zuerst auf Professor Excel.
]]>In many cases, the metadata is very useful: You can easily see who edited the file the last time or when was it saved the last time. But sometimes, you want to remove this information. For example, when you send your file to a client and it still contains somehow data of your previous client.
This article introduces 5 methods to see, change and remove the metadata of your Excel file.
The first method is actually quite simple. Excel can show you the most relevant metadata – the “document properties”. Just follow these steps.
Most properties you can change here right away. Just click into the field (for example “Add a title” or “Add an author”).
The Windows Explorer can also show the most important metadata. The advantage is that you don’t even have to open the file. Say you have a password protected Excel file and still want to know when it was saved or what day it was created. Please note: If the file is password protected, some information is not show, e.g. the author name.
Follow these steps.
This method is especially useful if you want to remove all metadata before sharing your Excel file. Excel provides a function to check your file for you. Not only metadata, but anything possible confidential is found and can be removed with just a few clicks.
Unfortunately, the Document Inspector for many cases doesn’t provide further information (like the actual author name) but just offers to remove them. The advantage of this function is that you gain a comprehensive impression of all the issues – not only the metadata itself – but also other possibly confidential content.
You want to gain a quick impression of the metadata? We’ve added such function to our Excel addin “Professor Excel Tools”. Just click on “Info” on the righthand side of the “Professor Excel” ribbon.
It summarizes the following data.
Furthermore, you can see a summary of your content, e.g. the number of worksheets, hidden worksheets, headers and footers, hyperlinks, links to other workbooks and so on.
The best: With one click you can insert a summary worksheet so that you can comfortably copy and paste the information.
This function is included in our Excel AddIn 'Professor Excel Tools'
Learn more Download Free Trial
(No signup, download starts directly)
More than 10k people on Facebook can't be wrong.
Besides other document inspector, you can also manually check for other hidden data in your Excel file. The advantage of doing it manually: You can decide for each single item what to do with it. Remove, keep or change.
You could start with the following items.
Our 6th and last method is probably more relevant to advanced users. You can check all the raw contents of your file. It’s recommended to save your file, close it and create a copy. Rename the copy and replace the .xlsx in the by .zip. Now you can open the .zip file, click on “docProps” and open “core.xml”. Now you can see some main metadata and change it. But please be careful: some changes might damage your Excel file.
This article has more information concerning this method and provides more detailed instructions.
Was the information helpful in this article?
Der Beitrag Metadata in Excel: 6 Methods of How to See and Remove All MetaData erschien zuerst auf Professor Excel.
]]>Der Beitrag GETPIVOTDATA: Disable GETPIVOTDATA permanently in Excel erschien zuerst auf Professor Excel.
]]>
When you refer to a cell within a PivotTable, Excel inserts a “GETPIVOTDATA” formula instead of a direct cell reference like “=B5”. If you copy and paste it to another cell, let’s say the cell below, you still refer to the same cell. That would be different with direct cell links: =B5 would automatically change to =B6 when copying to the cell below.
Another problem occurs when you change the fields of your PivotTable or rename them. You will easily receive #REF errors in such case.
That’s why direct cell links are in most cases a better solution.
The steps for disabling GETPIVOTDATA are quite simple in Excel. You just have to insert a PivotTable and uncheck “Generate GetPivotData” within the PivotTable Options. The steps are shown in the following image.
From now on, Excel inserts direct cell links (e.g. =B6) and no more GETPIVOTDATA.
Are you interested to learn more about PivotTables? Here is a selection of articles.
Was the information helpful in this article?
Der Beitrag GETPIVOTDATA: Disable GETPIVOTDATA permanently in Excel erschien zuerst auf Professor Excel.
]]>Der Beitrag FIELDVALUE Formula in Excel: Insert Data of Companies and Countries (+Download) erschien zuerst auf Professor Excel.
]]>
Please note: As of now, FIELDVALUE is only available for Office 365 subscribers in the Insider channel.
The FIELDVALUE formula retrieves data from the internet (from socalled linked records) and adds them to your table. So far, the FIELDVALUE formula works for two types of data:
In order to use the FIELDVALUE formula, you have to prepare your data in a certain way. Because it only works with company names or geographic region names, you have to select a cell containing a company name or country name and define it as such. The following steps are shown for region names but they work the same way for companies.
That’s it in terms of the preparations. In the next paragraph you learn how to pull data of a geographic region into an Excel cell.
In the previous paragraph you’ve learned how to prepare your Excel cell in order to retrieve data about a geographic region (or company). Now we continue by inserting the actual data. This is done using the FIELDVALUE formula.
The structure of the FIELDVALUE formula is shown on the righthand side. It has only two arguments. The value and the field name.
Excel also provides another method to refer to data types. This method avoids the FIELDVALUE formula, but it still has the same two arguments like the FIELDVALUE formula. The structure is shown in the image on the righthand side.
As for using the FIELDVALUE formula you have to prepare one cell by defining it as data type “Stock” or “Geography”. Now you can just refer to this cell (e.g. =A2) and adding the field name (e.g. population) with a “.”. Say you want to know the population of the city “Hamburg” and the city name “Hamburg” is given in cell A2. You simply type
=A2.Population.
Please note: If your FIELD_NAME contains ” ” space characters, you have to put [ ] around the field name. Example:
=A2.[Population: Income share third 20%]
You actually don’t even have to type the FIELDVALUE formula or the simplified version as shown above yourself. Excel can do that for you. One condition: Your table has to be formatted as an Excel table.
Let’s take a look at two examples. In the first example we are going to retrieve data for countries. The second example is about pulling take of companies.
The goal: Get some basic data about countries, e.g. the population, area size, year established or the name and position of their leaders.
=FIELDVALUE(B$1,$A2). You don’t have to use the $signs but if you want to extend this formula lateron, it’s easier to just copy and paste it.
You can now add more columns or rows as shown in the screenshot above.
Inserting data about companies into your Excel sheet works almost the same way as for geographic regions. The only difference: You have to set your cell containing the company name to the linked data type “Company”.
=FIELDVALUE(C$2,$B3).
Coming with the new FIELDVALUE formula, Excel also has a new error type. When typing the formula you might receive the #FIELD! formula. In such case, please check the following things:
Microsoft says that PivotTables, Power Pivot, Power Query or even some charts won’t work well with the new data types. However, in a short test, at least PivotTables seemed to work. Maybe you just give it a try…?
As of now, you have to set English to your editing language of Office. Other languages aren’t supported. Microsoft promises to support more languages in the future, though.
For now, the data itself is very limited.
The following data types are currently available.
Geography  Stock 


Geography  Stock 


Please feel free to download the examples above in one Excel file. Just click on this link and the download starts. Please note: If you get a #VALUE error message it’s possible that your Excel version doesn’t support the new data types yet.
Was the information helpful in this article?
Der Beitrag FIELDVALUE Formula in Excel: Insert Data of Companies and Countries (+Download) erschien zuerst auf Professor Excel.
]]>Der Beitrag Excel AddIn Disappeared? 4 Methods to Prevent an AddIn to Disappear erschien zuerst auf Professor Excel.
]]>In a hurry?
Before we start: This article deals with disappearing Excel addins. Not socalled COM addins. Excel addins are basically workbooks, saved as .xlam files.
Although our Excel addins (Professor Excel Tools, Break Link Tool, Currency Converter as well as the Password Manager) are coming as an .exe setup file, the core file is also an .xlam Excel addin. So the following methods apply for the addins that you’ve downloaded from this website.
One more thing before we start: Please make sure that the addin file hasn’t been moved, renamed or deleted? Unfortunately, in such case you’d not necessarily receive an error message when opening Excel.
Yes, it’s possible to just open Excel addins by just doubleclicking on the .xlamfile. The disadvantage is that if you open an addin that way, it will disappear every time you open Excel.
But there is a solution: Activate the addin from within Excel by following these steps:
That’s it. If the addin doesn’t disappear any longer after restarting Excel, you can stop here. But if it’s still gone, please proceed with either method 2 or method 3 below.
This method is comparatively simple but it has one disadvantage: In case of updates to your addin you have to apply the steps again.
Please note: This method only works after you’ve activated the addin from within Microsoft Excel according to the method 1 above. It won’t work, if you’ve just doubleclicked on the addin file in order to open it.
The third method requires some more steps but is – compared to our second method above – the better way. The reason is that when you update your addin or add another addin you don’t have to repeat the steps again.
You have programmed the addin yourself? It’s possible that the ribbon part has bugs – for example a picture for a button is missing. So I’d recommend to carefully debug your XML file, making sure that the XML part doesn’t have any errors.
I use the free software Custom UI Editor to create a ribbon. It also provides a rudimentary “validate” function. Please check for the following things:
Sorry for not being more specific here but this is a very individual process.
Was the information helpful in this article?
Der Beitrag Excel AddIn Disappeared? 4 Methods to Prevent an AddIn to Disappear erschien zuerst auf Professor Excel.
]]>Der Beitrag Sort Excel Sheets: 3 Simple Methods (+Download) erschien zuerst auf Professor Excel.
]]>
Yes, it sounds stupid. But there is no builtin function in Excel for sorting worksheets. Because of that, in many cases it’s really the fastest method to sort sheets per draganddrop with the mouse. You can also use the “move worksheets” function (rightclick on the sheet name), but according to my experience this function takes much longer than just using dragging the sheets around using the mouse.
Maybe a small tip at this point. If you press and hold the Ctrl key on the keyboard while dragging worksheets around, you create a copy of the worksheet instead of moving it.
You’ve probably skipped the first method because you have too many worksheets or you are looking for a recurring solution. Again, Excel doesn’t offer a builtin function for sorting worksheets. So you could just copy and paste one of the following VBA macros. Follow these steps:
If you need assistance with inserting a VBA macro, please refer to this article.
Macro 1. Sort sheets alphabetically in ascending order.
Sub sortAscending() Dim i, n, k As Double 'Count the number of worksheets and store the number in variable "n" n = Application.Sheets.Count 'Do the following look for each worksheet again For i = 1 To n 'Loop through all worksheets until the second last one (later you use the .move after function) For k = 1 To n  1 'If the name is larger than the following worksheet, change the sequence of these two worksheets. 'In order to enable a proper comparison, change all characters to lower case (UCase = Upper case works 'the same way. If LCase(Sheets(k).Name) > LCase(Sheets(k + 1).Name) Then Sheets(k).Move after:=Sheets(k + 1) Next Next End Sub
Macro 2. Sort sheets alphabetically in descending order.
Sub sortDescending() Dim i, n, k As Double 'Count the number of worksheets and store the number in variable "n" n = Application.Sheets.Count 'Do the following loop for each worksheet again For i = 1 To n 'Loop through all worksheets until the second last one (later you use the .move after function) For k = 1 To n  1 'If the name is smaller than the following worksheet, change the sequence of these two worksheets. 'In order to enable a proper comparison, change all characters to lower case (UCase = Upper case works 'the same way. If LCase(Sheets(k).Name) < LCase(Sheets(k + 1).Name) Then Sheets(k).Move after:=Sheets(k + 1) Next Next End Sub
Please feel free to download the VBA code in an Excel file. Click here for starting the download.
You don’t want to struggle with a VBA macro? Or you need further options for finetuning the sorting? There are some Excel addins available for sorting worksheets. Also our Excel addin “Professor Excel Tools” provides such function.
Follow these steps:
That’s it.
You can try “Professor Excel Tools” for free. Click here and the download start immediately.
Was the information helpful in this article?
Der Beitrag Sort Excel Sheets: 3 Simple Methods (+Download) erschien zuerst auf Professor Excel.
]]>Der Beitrag Array Formulas in Excel: All You Need to Know erschien zuerst auf Professor Excel.
]]>
Microsoft writes about array formulas:
To become an Excel power user, you need to know how to use array formulas, which can perform calculations that you can’t do by using nonarray formulas.
This article explains the basics of array formulas and provides examples.
Array formulas extend normal formulas. An array is a range of at least two or more cells. They are also referred to by “CSE” formulas which stands for Control, Shift, Enter. The reason is that after typing an array formula into an Excel cell, you must press Ctrl + Shift + Enter instead of just Enter. By pressing Ctrl + Shift + Enter, Excel adds the curly brackets { and } around the formula.
There are two types of array formulas:
Typically, an array formula performs several calculation steps in one formula. And that’s where array formulas are interesting for lookups: They can replace helper columns. This is especially useful, if the input data should stay “untouched”.
So how to create a simple array formula in Excel? Let’s say you’ve got 3 products, each with amount sold and price as shown in the screenshot on the righthand side. You want to know the total revenue.
The formula in cell D7 is
{=SUM(C3:C5*D3:D5)}
The curly brackets are added when pressing Ctrl + Shift + Enter. The underlying calculation steps are as follow:
=C3*D3+C4*D4+C5*D5 =300*24+350*26+400*22 =7200+9100+8800 =25100
This is probably an easy example for a singlecellarray formula. Of course, the result can also be achieved with the SUMPRODUCT formula or an additional helper column.
One recommendation: Because array formulas are often difficult to understand it’s worth noting that the formula auditing tools work for them as well. So you can follow up the calculation steps of an array formula with the formula auditing tools in Excel quite well. In order to achieve this, click on “Evaluate Formula” on the “Formula” ribbon. Now you can see each calculation step.
When deleting array formulas, you have to differentiate between singlecellarray formulas in multicellarray formulas.
Deleting singlecellarray formulas is quite simple: Just select the cell containing the array formulas and press the delete key on the keyboard. Alternatively select the cell to delete, click on “Clear” on the Home ribbon and then on “Clear Contents” or “Clear All”.
If you want to delete multicellarray formulas, you have to work a little bit harder. Instead of just selecting one cell, you have to select all cells belonging to the current array of cells. If you don’t catch all related cells at the same time, you’ll receive the “You can’t change part of an array” error message.
So how to select the whole array (that means all cells belonging to the current multicellarray)?
Excel too slow? Speed it up. Get the book now!
Tired of waiting for Excel? Use the 30 best methods described in this book to speed up Excel calculations!
Learn more or get it on Amazon!
In practice you have to change the size of an array formula comparatively often. Unfortunately, that is not as simple as it sounds. Single cell array formulas are usually not a problem because you can handle them like normal formula cells. So once again, it’s the multicell array formulas that are challenging.
The first approach (and often the fastest way to change the size of multicell array formulas) is to delete the complete formula and set it up again from the beginning. Especially in cases with complex array formulas this method might be troublesome. But in such case also the following second approach for resizing array formulas causes similar troubles.
The second approach is use the existing multicell array formula, change the cell references within the formula and apply it to the complete cell range. To demonstrate this, please take a look at the following example as shown in the screenshot on the righthand side.
In this example you already have a simple TRANSPOSE formula. It exchanges rows and columns of the cells B3 to C4. The task is to extend it to some new data given in cells B5 and C5 (the highlighted cells).
Please note the following rules for resizing multicell array formulas in Excel.
Like nonarray formulas (“normal formulas) you can work with numbers or other values in array formulas, socalled array constants. Array constants are a set of static values that don’t change. They can be used as arguments within array formulas. An example is shown in Figure 86. The constants are embraced by curly brackets and each value is separated by a semicolon.
You have to manually insert the curly brackets around the array constants. Additionally, you have to press Ctrl + Shift + Enter after editing the formula so that a second pair of curly brackets is added around the whole formula.
We’ve said before that each value should be separated by a semicolon. A semicolon in terms of array constants means that all values are in one column. If you instead separate the values with commas, the values are in one row. Now you can combine commas and semicolons. That way you create two dimensional array constants, similar to an Excel table with rows and columns.
Example: The following formula…
={"Q1 2017","Q2 2017","Q3 2017","Q4 2017";"Q1 2018","Q2 2018","Q3 2018","Q4 2018"}
…translates into this table:
Q1 2017  Q2 2017  Q3 2017  Q4 2017 
Q1 2018  Q2 2018  Q3 2018  Q4 2018 
As you can see the first four value from “Q1 2017” to “Q4 2017” are separated by commas. These values represent the first row. Starting from the semicolon the second row starts.
Let’s take it to the next level now. So now you know how to handle array constants. Next you can assign a name to the array constant. That way you don’t have to type it again in your array formula but instead only use the array constant by inserting the name into your formula.
Recommendation: Type your array constant one time directly into an Excel cell and test it. If it works, copy it. Now continue with the following steps (the number relate to the image on the righthand side).
In this article you learned the basics of array formulas. Especially relevant for some special lookups, for example VLOOKUP to the left or VLOOKUPS with several criteria rely on array formulas. Some of these special lookups don’t have a nonarray alternative. In such case you have to use array formulas. Furthermore – although probably nowadays not that relevant any longer – you could reduce the file size of Excel workbooks because you can conduct several calculation steps within one formula.
That said it’s time for some disadvantages and words of caution about array formulas.
Please feel free to download the examples from this article in one Excel workbook. Just click here to start the download.
Was the information helpful in this article?
Der Beitrag Array Formulas in Excel: All You Need to Know erschien zuerst auf Professor Excel.
]]>Der Beitrag Insert Author Name, Date Last Saved, File Size into Excel Cell: 3 Methods (+Free Download) erschien zuerst auf Professor Excel.
]]>
I know, it sounds stupid, but often doing it manually is the fastest way and doesn’t come with some of the disadvantages of the next two methods. Just type the current date or your name into the dedicated Excel cell.
In case you want to show the current time you could also use a keyboard shortcut. Press Ctrl + Semicolon (;) on the keyboard and Excel will write the current date into the currently selected Excel cell.
Because there is no automatic builtin way to return some of the meta data of your file in an Excel cell, you need to use a VBA macro. Therefore, you have to insert a new VBA module to your workbook. If you need assistance with the, please refer to this article. Once you have a new Excel module, simply copy and paste one of the following code snippets into this module. As you have done all the preparations now you can use the corresponding Excel formula in your worksheet.
Example: Insert the date last saved into an Excel cell.
Function ProfessorExcelLastSaveDate() ProfessorExcelLastSaveDate = FileDateTime(ActiveWorkbook.FullName) End Function
=ProfessorExcelLastSaveDate()
Please note: In order to show correct values for some of the formulas, you have to save your workbook first.
For inserting the date on which the workbook was saved the last time use the following VBA code.
Function ProfessorExcelLastSaveDate() ProfessorExcelLastSaveDate = FileDateTime(ActiveWorkbook.FullName) End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelLastSaveDate()
VBA macro code for inserting the date the workbook was created.
Function ProfessorExcelDateCreated() ProfessorExcelDateCreated = ThisWorkbook.BuiltinDocumentProperties("Creation date") End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelLastSaveDate()
VBA macro code for inserting the name of the person who saved the workbook the last time.
Function ProfessorExcelLastSavedBy() ProfessorExcelLastSavedBy = ThisWorkbook.BuiltinDocumentProperties("Last Author") End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelLastSavedBy()
VBA macro code for inserting the author name of your Excel workbook.
Function ProfessorExcelAuthor() ProfessorExcelAuthor = ThisWorkbook.BuiltinDocumentProperties("Author") End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelAuthor()
VBA macro code for inserting the file size of your Excel workbook.
Function ProfessorExcelFileSize() ProfessorExcelFileSize = FileLen(ThisWorkbook.FullName) End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelFileSize()
Are you looking for a more comfortable way? A method, in which you don’t have to use a VBA macro? The Excel addin “Professor Excel Tools” offers exactly that.
What do you have to do? Just download the addin (click here). Don’t worry, the integrated formulas also work after the trial period is over. Then type one of the following formulas in your Excel cell.
The formula looks like this:
=PROFEXDateLastSaved(A1). Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
The formula looks like this:
=PROFEXDateCreated(A1). Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
The formula looks like this:
=PROFEXLastSavedBy(A1). Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
The formula looks like this:
=PROFEXAuthor(A1). Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
The formula looks like this:
=PROFEXFileSize(A1). Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
This function is included in our Excel AddIn 'Professor Excel Tools'
Learn more Download Free Trial
(No signup, download starts directly)
More than 10k people on Facebook can't be wrong.
Please feel free to download all examples above in one Excel workbook. Just click on this link and the download starts right away.
Was the information helpful in this article?
Der Beitrag Insert Author Name, Date Last Saved, File Size into Excel Cell: 3 Methods (+Free Download) erschien zuerst auf Professor Excel.
]]>Der Beitrag Disable AutoSave in Office Permanently erschien zuerst auf Professor Excel.
]]>
AutoSave, you might say, didn’t I have this option for a long time already? Actually, there is a similar option which is still available in Office. It’s called AutoRecover. AutoRecover saves a copy of you file in a time period which you can define, e.g. every 10 minutes.
My opinion: If the AutoRecover function would work well, it’s a good method to make sure you have some kind of backup of your work. Unfortunately, especially for larger Excel files, it seems to not really work properly. I even gained the impression that the AutoRecover function was the reason for Excel crashing.
If you only want to disable the new AutoSave function for the current file, just click on the AutoSave button in the Quick Access Toolbar. The first time you use the AutoSave function you might also see a notification is shown on the image on the righthand side.
So what if you don’t have the AutoSave toggle in your Quick Access Toolbar? Unfortunately the only option is to add it to the Quick Access Toolbar. In a nutshell rightclick on the Quick Access Toolbar, then click on “Customize Quick Access Toolbar”, select “AutoSave” and click on “Add >>”. If you need assistance with the Quick Access Toolbar please refer to this article.
As mentioned before, there is no builtin way to disable the AutoSave function permanently from within Excel, PowerPoint or Word. However, you can achieve this by adding a value to the Windows registry. One word of caution: Please be careful when editing the Windows registry. Wrong changes can have a major impact on your computer.
There are two options of setting the correct value to the registry. Manually and automatically by downloading and opening a file.
Follow these steps for adding the registry entry to disable the new AutoSave function in Excel manually.
Please note the following comments.
If you don’t want to navigate through the Windows registry yourself, we’ve prepared files for you to download. Depending on which Office program you want to disable the AutoSave in, download the respective file below. Open it and confirm the security question. That’s it.
If you want to restore or reenable the function, use the respective file below.
Please feel free to download all mentioned registry entries below.
Disable AutoSave…  Enable AutoSave… 

… in Excel  … in Excel 
… in PowerPoint  … in PowerPoint 
… in Word  … in Word 
… in Excel, PowerPoint and Word at the same time  … in Excel, PowerPoint and Word at the same time 
or download all files as one zip file.
Was the information helpful in this article?
Der Beitrag Disable AutoSave in Office Permanently erschien zuerst auf Professor Excel.
]]>Der Beitrag Count Number of Unique Records in Excel: 5 Methods (+Download) erschien zuerst auf Professor Excel.
]]>
The example is shown in the image on the righthand side. A list of ten persons contains three columns. The values are the results from a game a group of friends were playing. Column A has the name of the person, column B the number of trial and column C the result per person and trial. You want to answer two questions:
If you only want to count the number of unique records once and don’t have to automatically update the result, you could use the function called “Remove Duplicates”. It’s a builtin function in Excel and you can find it within the “Data”ribbon.
Alternatively, you could use the COUNT and COUNTIFS formulas.
Please note:
The next method—using advanced filters—works very similar to the previous method removing duplicates. Advanced filters in Excel provide a function to filter to unique records only. Duplicates or multiple values will just be hidden as you are probably familiar from normal filters. The steps are shown in screenshot on the righthand side.
Hold on a second. Was this information helpful so far?
If yes: Why don't you subscribe to our monthly, free Excel newsletter? You get all this:
The best Excel tips, tricks and tutorials.
1x per month.
No spam. Promised.
Subscribe now!
PivotTables are very powerful in Excel. Coming with the versatility, they are often complex to set up. In this part we take a rough look at the necessary steps to answer the questions using PivotTables. Because PivotTables could fill books themselves, we concentrate on the crucial steps rather than going too much into detail of all their basics.
PivotTables have the advantage that with an update of the data, they can be refreshed. Our previous methods 1 and 2 can’t be easily refreshed—at least not without going through all the steps again. On the other hand, PivotTables aren’t as dynamic as using Excel formulas.
The necessary steps are shown in the image on the righthand side.
Answering the second question is a little bit trickier. The question is “How many people had a result higher than 40 in the first trial?”. You can use the same PivotTable you’ve just created for answering the first question and add some modifications.
The previous methods 1, 2 and 3 aren’t entirely dynamic. That means, with an update of the data, the results don’t automatically change without further steps. Even the PivotTable in our method 3 requires a refresh. Out methods 4 and 5 don’t have such constraints. They automatically update their results because they are based on Excel formulas.
This method is based on the two Excel formulas SUMPRODUCT and COUNTIFS. For more information about these two formulas please refer to SUMPRODUCT and COUNTIFS.
The formula is comparatively short and works for up to one criteria. So, the second question of our example―as it requires two criteria―can’t be solved with this formula combination. In such case, please proceed with the following method 5.
The base formula combination is shown in the image above.
The COUNTIFS formula returns an array of numeric values. It has one value for each record of your data saying how many times it occurs. If one value only appears once, it will have the number 1. If it one the other hand appears twice, it will have two times 2. The &”” signs prevent blank cells (will be regarded as zeroes) to be regarded. If you don’t add &””, blank cells will be regarded as one record.
Now these numbers just have to be added up. To make the formula combination universably usable, we choose SUMPRODUCT right away. In a simplified version of the formula, this also works just using SUM and inserting it as an array formula.
After applying this formula to our example in this article―counting the number of different persons in cell range A2 to A11―you will have the following formula.
=SUMPRODUCT(1/COUNTIFS(A2:A11,A2:A11&""))
Now we add a condition. Because this formula regards empty cells as one unique record, the condition might be, that cells mustn’t be empty. The condition can be entered instead of the 1 in the beginning of the SUMPRODUCT formula like in the image on the righthand side.
If the condition is, that empty cells don’t count, the condition would be COUNT_RANGE<>””. For your example that means
=SUMPRODUCT((A2:A11<>"")/COUNTIFS(A2:A11,A2:A11&""))
You can of course use different criteria. But again, only one criteria or condition is possible. The second question of your example is “How many people had a result higher than 40 in the first trial?”. This question requires two conditions (higher than 40 and the first trial). But answering the question of how many people had a result higher than 40 (without the condition that it must have happened in the first trial) is possible to answer with this formula. The result is given in cells C2 to C11. That means the criteria is (C2:C11>40). The complete formula is
=SUMPRODUCT((C2:C11>40)/COUNTIFS(A2:A11,A2:A11&""))
The last of our five methods is also the most complex one. It involves up to five different formulas combined to one long formula combination. But this is the only entirely dynamic solution for counting the number of unique records with multiple criteria.
The structure of the base formula combination is shown in the figure on the righthand side. You only have to insert two different parts.
Applying this formula on the previous example leads to the following formula.
=SUM((FREQUENCY(MATCH(A2:A11,A2:A11,0),ROW(A2:A11)ROW(A2)+1)>0)*1)
What does this formula do in the background? The basic formula is FREQUENCY (please refer to this article for more information).
=SUM((FREQUENCY({1,2,3,4,4,6,7,8,9,9},ROW(A2:A11)ROW(A2)+1)>0)*1)
=SUM((FREQUENCY({1,2,3,4,4,6,7,8,9,9},{1,2,3,4,5,6,7,8,9,10}>0)*1)
=SUM(({1,1,1,2,0,1,1,1,2,0,0}>0)*1)
=SUM(({TRUE,TRUE,TRUE,TRUE,FALSE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE})*1)
=SUM({1,1,1,1,0,1,1,1,1,0,0})
=8
After solving the first question of the example, it’s time to add one criteria. Because the formula as shown before can’t handle blank cells, the first condition will be to skip blank cells.
The structure of the FREQUENCY formula with one condition is shown in the image on the righthand side. As you can see, the formula hasn’t changed much. Just one part is added, illustrated with number 3. The condition is inserted using the IF formula. The corresponding closing blanket of the IF formula is after the MATCH formula. If the condition is not met, this part of the formula returns FALSE. This results in also FALSE at this point of the “DATA ARRAY” of the FREQUENCY formula.
The condition itself is added the following way:
(CONDITION_RANGE=CONDITION)
The condition of our example table is that empty cells should be skipped. The CONDITION_RANGE is A2:A11 and the condition is <>””. Putting the condition into the complete formula leads to the following formula.
=SUM((FREQUENCY(IF(B2:B11<>"",MATCH(A2:A11,A2:A11,0)),ROW(A2:A11)ROW(A2)+1)>0)*1)
After knowing how to handle one conidition, it’s time to proceed with the second question of our example: How many people had a result higher than 40 in the first trial?
The same way the first condition is added, a second can be inserted. Just add one more IF formula before the existing IF formula. The corresponding closing bracket needs to be entered after the MATCH formula.
In the example of this chapter, the trial number is located in cells B2 to B11 and should be the first trial. The second criteria range is the result, located in cell range C2 to C11 and should be higher than 40. Regarding these two criteria leads to the following formula.
=SUM((FREQUENCY(IF(C2:C11>40,IF(B2:B11="1st trial",MATCH(A2:A11,A2:A11,0))),ROW(A2:A11)ROW(A2)+1)>0)*1)
Once again, the hint: All formulas shown in this method are array formulas. After pressing Ctrl + Shift + Enter on the keyboard, curled brackets are added so that the formula―when seeing in the formula bar―look like this.
{=SUM((FREQUENCY(IF(C2:C11>40,IF(B2:B11="1st trial",MATCH(A2:A11,A2:A11,0))),ROW(A2:A11)ROW(A2)+1)>0)*1)}
Please feel free to download all examples above in this Excel workbook. Click here and the download starts.
Was the information helpful in this article?
Der Beitrag Count Number of Unique Records in Excel: 5 Methods (+Download) erschien zuerst auf Professor Excel.
]]>Der Beitrag FREQUENCY Formula in Excel: Everything You Should Know (+Download) erschien zuerst auf Professor Excel.
]]>
The FREQUENCY formula counts, how often values occur within a range of values. Say you have a set of numeric numbers, for example 2, 4, 4, 5, 6, 7, 7, 9. Now you want to know how many of your number of less than or equal to 5, how many are between 6 and 7 and how many are larger than 8. FREQUENCY counts for each of these three classes the number of values and returns an array containing exactly these three numbers. So the result of the schematic example on the righthand side would be the array {4,3,1}.
The FREQUENCY formula has two arguments as shown in the image on the righthand side.
FREQUENCY is a multicellarray formula. That means, in it’s base version it returns an array of values which can be returned to multiple cells. Before you enter the FREQUENCY formula you should select all regarding cells. The results of the formula stretches over the number of cells as the second argument has bins plus one more cell. The reason is that you define the bin borders and you always have one additional bin. Say, you just have one bin (e.g. “5”) then you have the two classes smaller and equal the bin border and larger than the bin border.
The screenshot on the righthand side shows a simple example for the FREQUENCY formula. The cell range B4 to C13 contains a list of people and their age in years. You want to know how many people are younger than 30 years old, how many between 35 and 40, and so on. These interval borders are given in cells E4 to F8. The cells G4 to G8 should show the corresponding number of people for each age class. Do the following steps for entering the formula.
Please note: Usually you could achieve the same result with the COUNTIFS formula. Because the COUNTIFS formula has some advantages towards FREQUENCY you should consider for such case as in this example to use the COUNTIFS formula. The advantages of COUNTIFS include that it’s more flexible for changes, can be “finetuned” better and is usually faster than an array formula.
Please feel free to download all examples above in this Excel workbook. Click here and the download starts.
Der Beitrag FREQUENCY Formula in Excel: Everything You Should Know (+Download) erschien zuerst auf Professor Excel.
]]>