Der Beitrag Sort Excel Sheets: 3 Simple Methods (+Download) erschien zuerst auf Professor Excel.
]]>
Yes, it sounds stupid. But there is no built-in function in Excel for sorting worksheets. Because of that, in many cases it’s really the fastest method to sort sheets per drag-and-drop with the mouse. You can also use the “move worksheets” function (right-click 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 built-in 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 fine-tuning the sorting? There are some Excel add-ins available for sorting worksheets. Also our Excel add-in “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 non-array 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 right-hand 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 single-cell-array 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 single-cell-array formulas in multi-cell-array formulas.
Deleting single-cell-array 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 multi-cell-array 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 multi-cell-array)?
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 multi-cell array formulas that are challenging.
The first approach (and often the fastest way to change the size of multi-cell 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 multi-cell 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 right-hand 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 multi-cell array formulas in Excel.
Like non-array formulas (“normal formulas) you can work with numbers or other values in array formulas, so-called 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 semi-colon.
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 semi-colon. A semi-colon 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 semi-colons. 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 semi-colon 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 right-hand 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 non-array 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 + Semi-colon (;) on the keyboard and Excel will write the current date into the currently selected Excel cell.
Because there is no automatic built-in 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 add-in “Professor Excel Tools” offers exactly that.
What do you have to do? Just download the add-in (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 Add-In 'Professor Excel Tools'
Learn more Download Free Trial
(No sign-up, 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 right-hand 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 right-click 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 built-in 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 re-enable 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 right-hand 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 built-in 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 right-hand 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 right-hand 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 right-hand 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 right-hand 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 right-hand 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 right-hand side would be the array {4,3,1}.
The FREQUENCY formula has two arguments as shown in the image on the right-hand side.
FREQUENCY is a multi-cell-array 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 right-hand 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.
]]>Der Beitrag Return Blank Cells Instead of Zeroes in Excel Formulas erschien zuerst auf Professor Excel.
]]>
Probably the easiest option is to just not display 0 values. You could differentiate if you want to hide all zeroes from the entire worksheet or just from selected cells.
There are three methods of hiding zero values.
For details about all three methods of just hiding zeroes, please refer to this article.
Unlike the first option, the second option changes the output value. No matter if the return value is 0 (zero) or originally a blank cell, the output of the formula is an empty cell. You can achieve this using the IF formula.
Say, your lookup formula looks like this:
=VLOOKUP(A3,C:D,2,FALSE)(hereafter referred to by “original formula”). You want to prevent getting a zero even if the return value―found by the VLOOKUP formula in column D―is an empty value. This can be achieved using the IF formula.
The structure of such IF formula is shown in the image above (if you need assistance with the IF formula, please refer to this article). The original formula is wrapped within the IF formula. The first argument compares if the original formula returns 0. If yes―and that’s the task of the second argument―the formula returns nothing through the double quotation marks. If the orgininal formula within the first argument doesn’t return zero, the last argument returns the real value. This is achieved by the original formula again.
The complete formula looks like this.
=IF(VLOOKUP(A3,C:D,2,FALSE)=0,"",VLOOKUP(A3,C:D,2,FALSE))
The previous option two didn’t differentiate between 0 and empty cells in the return cell. If you only want to show empty cells if the return cell found by your lookup formula is empty (and not if the return value really is 0) then you have to slightly alter the formula from option 2 before.
Like before, the IF formula is wrapped around the original formula. But instead of testing if the return value is 0, it tests within the first argument if the return value is blank. This is done by the double quotation marks. The rest of the formula is the as before: With the second argument you define that—if the value from the original formula is blank—the return value is empty too. If not, the last argument defines that you return the desired non-blank value.
The formula in your example from option 2 looks like this.
=IF(VLOOKUP(A3,C:D,2,FALSE)="","",VLOOKUP(A3,C:D,2,FALSE))
Der Beitrag Return Blank Cells Instead of Zeroes in Excel Formulas erschien zuerst auf Professor Excel.
]]>Der Beitrag Convert Table to One Column in Excel: 4 Easy Methods to Copy All Columns underneath Each Other erschien zuerst auf Professor Excel.
]]>Say you have an Excel table and want to copy all column underneath each other so that you only have one column. For example, you have a table 2 rows by 4 columns like in the screenshot on the right-hand side. You want to copy and paste this table to one column. You often need such transformation for inserting PivotTables or to create database formats. This article provides 4 simple methods to transform a 2-dimensional table into one column in Excel.
The following methods will be introduced with a simplified example as shown on the right-hand side. You have a table with numbers within the cell range A1 to G7. That means you have 7 rows and also 7 columns. In total 49 cells to be copied to one column.
Like so often, copying and pasting the columns manually might be the fastest solution. Given that you are reading this article, this might not be the method you want to hear. But anyway, doing it manually is often the fastest way.
Maybe some advice to speed up the manual process might help. Try to use as many keyboard shortcuts as possible. That way you could save some time.
For more information about the keyboard shortcuts please refer to our big keyboard shortcut package.
You can convert a two-dimensional table into just one column by using the INDEX formula. Unfortunately, it requires some preparations. But on the other hand, it’s one of the faster ways (compared to setting up the more complex OFFSET formula like in method 3 below or the INDIRECT formula).
Let’s see what you need to prepare. Basically you have to create the column and row number in additional helper columns. That way you can easily refer to the original table. The screenshot on the right-hand side shows the necessary preparations.
=INDEX($A$1:$G$7;A10;B10). Example: In cell C10, the INDEX formula returns the value from the first row and first column of the range A1 to G7.
Please refer to this article for more information about the INDEX formula in Excel.
The third method uses the OFFSET formula for copying several columns underneath each other to one column. If you need some introduction to the OFFSET formula, please refer to this article.
Because the formula is – in this universal case – very long, we don’t go much into detail here. It’s based on three cells.
Now you just have to replace the cell links in the following formula with your cells. Don’t forget to fix the references with the $-signs as shown in the formula below.
=OFFSET($A$1,(ROW()-ROW($A$9)-1)-(ROW($A$7)-ROW($A$1)+1)*ROUNDDOWN((ROW()-ROW($A$9)-1)/(ROW($A$7)-ROW($A$1)+1),0),ROUNDDOWN((ROW()-ROW($A$9)-1)/(ROW($A$7)-ROW($A$1)+1),0))
In order to make it easier for you to use the formula, you can use the version below. All you have to do is to give names to the three main cell as shown in the image on the right-hand side. In order to achieve this, select the top left cell of your original table (here: A1) and click into the name field. Type “TopLeftCell” and press Enter on the keyboard. Repeat this with the bottom left cell (name “BottomLeftCell”) as well as the heading cell of your new table (name “HeadingCell”).
Once done, copy and paste the following formula it the first cell (here: A10). Now just copy and paste this cell down until all columns from your original table are covered.
=OFFSET(TopLeftCell,(ROW()-ROW(HeadingCell)-1)-(ROW(BottomLeftCell)-ROW(TopLeftCell)+1)*ROUNDDOWN((ROW()-ROW(HeadingCell)-1)/(ROW(BottomLeftCell)-ROW(TopLeftCell)+1),0),ROUNDDOWN((ROW()-ROW(HeadingCell)-1)/(ROW(BottomLeftCell)-ROW(TopLeftCell)+1),0))
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!
You want to use the most convenient way? Try the Excel add-in “Professor Excel Tools”. The steps are shown in the screenshot on the right-hand side.
That’s it. Do you want to try “Professor Excel” for free? Then just follow this link for more information or start the download right away.
This function is included in our Excel Add-In 'Professor Excel Tools'
Learn more Download Free Trial
(No sign-up, download starts directly)
More than 10k people on Facebook can't be wrong.
Please feel free to download all examples shown above in one comprehensive Excel file. Just click on this link and the download starts right away.
Was the information helpful in this article?
Der Beitrag Convert Table to One Column in Excel: 4 Easy Methods to Copy All Columns underneath Each Other erschien zuerst auf Professor Excel.
]]>Der Beitrag Named Ranges in Excel: See All Defined Names (Incl. Hidden Names) erschien zuerst auf Professor Excel.
]]>
Please take a look at the screenshots below. On the left-hand side you can see the built-in Excel Name Manager (you can access it though Formulas–>Name Manager). The right-hand side is a screenshot of the Excel add-in “Professor Excel Tools” (more to that later). They were both taken with the same Excel workbook.
As you can see, the built-in Name Manager only shows none-hidden names. There are 4 names names in this workbook which are not hidden. But there are thousands more defined names in this particular workbook. Excel just doesn’t show them to you.
The problem with not showing all defined names is that you can’t delete them. Because they are hidden. Let’s talk a little bit about defined names in Excel.
The first method is to access the source file of your Excel workbook. Please refer to this article for information about the source contents of an Excel file.
Please note: Tempering with the source code of your Excel file might damage the file. So please only work with copies of your file.
Our next method to edit hidden names in Excel is via VBA macros. We have prepared two VBA macros. Please insert a new VBA module and paste the following codes. If you need assistance concerning macros, please refer to this article.
This first VBA macros makes all defined names visible. You can then edit them within the built-in Name Manager (go to Formulas–>Name Manager). After pasting this code snipped into the new module, place the cursor within the code and click on the play button on the top of the VBA editor (or press F5 on the keyboard).
Sub unhideAllNames() 'Unhide all names in the currently open Excel file For Each tempName In ActiveWorkbook.Names tempName.Visible = True Next End Sub
If you want to hide all names in your current workbook, replace tempName.Visible = True by tempName.Visible = False.
The following VBA macros deletes all names in your workbook.
Sub removeAllNames() 'Remove all names in current workbook, no matter if hidden or not For Each tempName In ActiveWorkbook.Names tempName.Delete Next End Sub
One word of caution: Print ranges and database ranges are also stored as defined names. Before you delete all names, make sure that you really don’t need them any longer.
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!
This last VBA macro only deletes all hidden names in your workbook.
Sub removeAllHiddenNames() 'Remove all hidden names in current workbook, no matter if hidden or not For Each tempName In ActiveWorkbook.Names If tempName.Visible = False Then tempName.Delete End If Next End Sub
Because this problem is – if it occurs – very troublesome, we’ve included our own version of a “Name Manager” into the Excel add-in “Professor Excel Tools“. As you can see on the screenshot on the right-hand side, it shows all names including hidden names.
You can then hide or unhide defined names. Or directly delete them.
This function is included in our Excel Add-In 'Professor Excel Tools'
Learn more Download Free Trial
(No sign-up, download starts directly)
More than 10k people on Facebook can't be wrong.
Defined names are usually useful in Excel. Unfortunately, with built-in methods, hidden names can’t be edited. That could be a problem when you copy a worksheets and have to confirm for each name separately if you want to keep it or rename it. With thousands of names that could take a while.
Unfortunately, Excel doesn’t provide functions to edit such hidden names. You could work on them manually, with VBA macros or third party add-ins such as “Professor Excel Tools“.
Was the information helpful in this article?
Der Beitrag Named Ranges in Excel: See All Defined Names (Incl. Hidden Names) erschien zuerst auf Professor Excel.
]]>Der Beitrag Equal-Plus in Excel: Why You Should Not Start a Formula With “=+” erschien zuerst auf Professor Excel.
]]>
Lotus 1-2-3 is a spreadsheet program and according to Wikipedia, it “was the IBM PC’s first killer application”. However, the last version was published in 2003 and support ended in 2014. Entering formulas or values in Lotus 1-2-3 you could use the “+”-sign instead of “=” like in Excel. In order to welcome Lotus 1-2-3 users, Excel tolerated entering formulas just using the “+”-sign. It automatically adds the “=”-sign before so that formulas are converted. The “+”-sign stays.
First of all: There is no harm of the =+-sign in the beginning of an Excel formula. With that in mind, let’s talk about advantages and disadvantages of using equal-plus instead of just equal for Excel formulas and calculations.
Lotus 1-2-3 users don’t have to change their behavior of entering formulas in Excel.
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!
Maybe it sounds similar, but the equal-plus sign for starting a formula in Excel doesn’t have anything to do with the double minus sign. The double negative converts TRUE and FALSE in formulas to the number 0 for FALSE and 1 for TRUE. When do you need that? For example in the SUMPRODUCT formula (please refer to this article for more information).
There are two methods to remove all “=+”-signs in Excel.
This function is included in our Excel Add-In 'Professor Excel Tools'
Learn more Download Free Trial
(No sign-up, download starts directly)
More than 10k people on Facebook can't be wrong.
Although the “=+”-sign doesn’t harm and doesn’t have any special meaning, there is no real advantage of using the “+”-sign to type a formula in Excel. Instead, there are minor disadvantages of the equal-plus version of formulas in Excel. And – and that’s my personal opinion on that matter – it looks dirty is just unnecessary…
When I receive an Excel file containing formulas with equal-plus signs, I usually have the following thoughts: Someone wants to show that he or she is an Excel expert by not using the “normal” way of typing formulas but rather using the more complicated way. Unfortunately, I get the opposite impression. The author of the Excel file didn’t use the simple way but rather the dirty, more complicated way. That’s not good for an Excel file.
What do you think? What is your opinion about the =+-characters at the beginning of an Excel formula?
Was the information helpful in this article?
Der Beitrag Equal-Plus in Excel: Why You Should Not Start a Formula With “=+” erschien zuerst auf Professor Excel.
]]>