# Trending December 2023 # How To Calculate Time Difference In Excel # Suggested January 2024 # Top 15 Popular

You are reading the article How To Calculate Time Difference In Excel updated in December 2023 on the website Bellydancehcm.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested January 2024 How To Calculate Time Difference In Excel

Microsoft Excel can be used for budget calculations, Tax calculations and for many other purposes. You can use it as another form of calculator due to the features it provides us. You can even make use of Excel to calculate the difference between two times. It helps calculate the number of hours an employee worked between the given start and end time. A whole record of employee working hours can be maintained using Excel which helps us to calculate wages or salaries to be paid for an employee.

Do you think it is very easy to calculate the time difference as it is just subtracting the end time from the start time? If you just go ahead and do the same, you will face two problems. Let us see what are they, and how can we handle them.

Calculate Time Difference in Excel

It is tough to calculate the difference between two times in Excel. But with a little bit of trick applied, we can achieve the result we want. Just follow this article till the end and there on you can calculate time differences in Excel perfectly. Here we go!

Just consider the sample data as below,

So, as discussed if we just try with subtracting the ‘End Time’ with the ‘Start Time’, you will be facing two problems and let’s see what are they.

You can see that result got appended with ‘AM’ or ‘PM’ which is not expected by us. The second problem is it shows hash errors. As we performed direct subtraction, the result might be negative in some cases and as the time should not be negative, Excel shows it as hash errors.

We can solve the first problem by changing the number format by following the simple below steps

Select the cells which have the result (Total Hours in our case) and press ‘CTRL+1’ to open the format cells dialog box.

In this way, you can get rid of the first problem. This is somewhat satisfying but even though it is not the complete solution which we are looking for. We still need to remove the hash errors in Total Hours calculated. To solve the second problem, you need to change the formula which you used in the first step (End Time – Start Time i.e. ‘E14-E13’). Select the Total Hours row and press ‘F2’ to change the formula. Make the formula as follows-

Now, instead of pressing the Enter, just press ‘CTRL+Enter’ so that the result is applied to all the selected cells in a single shot. This way we can avoid changing the formula for every cell.

We all know that 24 hours system is being used by Excel. The main tricky part used here to solve the hash errors is adding the logical operation. By doing so we have overcome the negative result as “TRUE” is treated as “1” and “FALSE” is treated as “0”. Finally, the time difference does not show the negative values and else no hash errors anymore.

This is the simple, easy and perfect way to calculate time differences in Microsoft Excel.

How do I calculate the time difference in Excel in 24 hours?

You're reading How To Calculate Time Difference In Excel

## Percentage Difference In Excel (Examples)

Percentage Difference in Excel

Percentage difference in Excel is a formula that calculates the percentage change between two numbers. The formula typically enables users to compare two values and determine how much they have increased or decreased concerning each other.

It is commonly used to analyze changes in values, such as sales, profits, or expenses, over a while. For instance, if you want to find out the percentage increase in sales from one year to another, you can use the percentage difference formula to compare the sales figures for both years. Thus, it will help you identify the percentage increase or decrease in sales and make informed decisions accordingly.

How to Calculate the Percentage?

Before understanding the calculation of percentage difference in Excel, let’s understand how to calculate the percentage manually.

You can download this Percentage Difference Excel Template here – Percentage Difference Excel Template

We will find out how much the percentage of 50 in 500.

First, we divide the 50, i.e., the smaller number, by 500, the greater number, which gives us the decimal value of 0.1. Then, we multiply the resulting decimal value by 100 to get the percentage (10%).

(50/500) X 100 = 10%.

Now let’s understand how to calculate percentages in Excel.

How to Calculate Percentage Differences in Excel?

Calculating the percentage difference in Excel is very simple and easy. Let’s understand how to calculate the percentage difference in Excel with some examples.

Example #1

Solution:

Once we calculate the difference between the employee population of 2023 and 2023, we can determine the percentage change in employee growth.

After multiplying by 100, we obtain the percentage results with several digits after the decimal point, which can be hard to read. To make the results more readable, we must round them off.

Here, we can observe that the employee population in Hyderabad increased by 20.93% from 2023 to 2023, while Chennai increased by 21.62%. Moreover, Bangalore saw a reduction of 6%, while Mumbai saw an increase of 2.50%.

It means that 900 is 20.93% of 4300, 800 is 21.62% of 3700, 300 is 6% of 5000, and 100 is 2.50% of 4000.

Example #2

Solution:

Explanation of Formula:

Subtract the current year’s salary in cell B3 (45,0000) from the previous year’s salary in cell B2 (40,0000). Then, multiply the difference by 100, and divide the result by the last year’s salary (40,0000).

Use the formula to calculate the percentage difference for each year. For example, for the years 2023 to 2023, the percentage increase in salary is 12.5%.

From the chart, we can observe the percentage change every year. If the percentage is negative, the bar will show under the baseline of 0.

It is clear how to calculate percentage and percentage differences in Excel and visually represent the percentage change using charts.

Applications of Percentage Difference

We can use the percentage difference method to keep track of stock price changes and change in market indexes. In addition, it can help compare the value of different currencies. The Percentage difference is also helpful for comparing financial statements in balance sheets.

Percentage difference helps to find out how much profit or loss your business has incurred on its sales.

It can help analyze the budgets set for various marketing activities such as Print marketing, email marketing, social media marketing, etc.

How to use Conditional Formatting in Excel to Highlight Percentage Differences that Meet Specific Criteria?

Let’s consider an example to understand using conditional formatting for highlighting percentage differences.

We have a list of purchased items with their budget and actual expense. Assuming we have already calculated the percentage difference between the budget and actual expense, let us see the steps to highlight these differences using conditional formatting:

Step 1: Select the calculated percentage difference

A Less Than window pops up to provide the value. It asks to provide a value to format cells less than the value.

We want to highlight over-budget cells, i.e., cells with negative values.

Step 3: Enter the value “0″.

How to use Excel Charts to Visualize Percentage Differences?

To create charts representing the above data, follow these steps:

Step 1: Select the table range.

It will display different types of chart formats you can choose from.

Things to Remember About Percentage Differences in Excel

Percentage difference represents the difference between an old and a new value in the percentage form, considering the old value as the base.

Moreover, it can be helpful to compare two values, to analyze how much the entity has deviated from its original value.

A positive percentage difference indicates an increase(growth), and a negative percentage difference indicates a decrease(decline) in the value.

To obtain the percentage difference between two values, find the difference between them, divide the result by the old integer, and then multiply the output by 100.

Additionally, if the difference results in multiple integers after the decimal point, we can consider rounding it off in Excel to display it better and for ease of understanding.

The percentage difference in Excel lets users analyze a business’s growth rate in terms of sales, acquisition of clients/ customers, marketing statistics, branding, or visualizing the scope of the utility of its products or services in the future.

Recommended Articles

This is our guide to Percentage Difference in Excel. We discuss calculating Percentage Differences in Excel, examples, and a downloadable Excel template here. You can also go through our other suggested articles:

## Javascript How To Calculate Age From Birthdate

To calculate the age from birthdate in JavaScript, you can use this function:

function age(birthdate) { const today = new Date(); const age = today.getFullYear() - birthdate.getFullYear() - (today.getMonth() === birthdate.getMonth() && today.getDate() < birthdate.getDate())); return age; }

Here’s an example use of this function (called on 10th Feb 2023):

const birthdate = new Date(2000, 2, 5); const ageValue = age(birthdate); console.log(ageValue);

Output:

22

I hope this quick answer helps.

If you have trouble understanding how this code works and what exceptions there are in calculating age (leap years), please read along.

Problems with Leap Years

In order to calculate a person’s age, you need to take into account the fact that a year has a slightly different length than a calendar year.

A year is approximately 365.25 days long, while a calendar year is 365 days.

To make up for this difference, every fourth year (with the exception of years that are divisible by 100 but not divisible by 400) is considered a leap year.

This discrepancy causes issues when trying to calculate a person’s age based on the number of days from their birthdate.

For example, a person born on January 1st, 2000 would turn 18 years old 6575 days later on January 1st, 2023 with 5 leap years between the time range.

However, a person born on January 1st, 2001 would turn 18 only 6574 days later on January 1st, 2023, with only 4 leap years in between.

All I’m trying to say is that if someone is 6574 days old, you cannot tell if they are 17 or 18 without knowing more information about their birthdate because of the leap years.

To calculate a person’s age in JavaScript, use the Date object and follow these two steps:

Subtract the birth year from the current year using the getFullYear method.

Subtract 1 if the current month and day come before the birth month and day using the getMonth and getDate methods.

const today = new Date(); function age(birthdate) { (today.getMonth() === birthdate.getMonth() && today.getDate() < birthdate.getDate()); let year_difference = today.getFullYear() - birthdate.getFullYear(); const age = year_difference - one_or_zero; return age; } console.log(age(new Date(2000, 0, 1)));

Output:

23

Note that in JavaScript, the months in a Date object are 0-based (i.e. January is 0, February is 1, etc.), whereas in Python they are 1-based (i.e. January is 1, February is 2, etc.).

A leapling is someone who was born on the leap day of a leap year (29th Feb).

This causes problems when calculating ages because, on a traditional year, that birthdate doesn’t exist. Usually, leaplings have their “official” birthday on 28th Feb or 1st Mar.

But technically, 1st Mar is the correct day because then a full year has passed since the leap day.

Let me show you how the above function’s logic handles the case where a person was born on February 29th, 2000 and we want to calculate their age on February 28th, 2001.

let birthdate = new Date(2000, 1, 29); let today = new Date(2001, 1, 28); let year_difference = today.getFullYear() - birthdate.getFullYear(); (today.getMonth() === birthdate.getMonth() && today.getDate() < birthdate.getDate()) ? 1 : 0; let age = year_difference - one_or_zero; console.log(age);

Since February 28th, 2001 is before the person’s birthdate of February 29th, 2000, the value one_or_zero is 1. This means that their age would be calculated as year_difference - 1, which is 1 - 1 = 0.

So the logic correctly identifies that a year hasn’t passed between Feb 29th, 2000 and Feb 28th, 2001.

Wrap Up

In this tutorial, you learned how to calculate age in JavaScript using the built-in Date object.

Calculating age may seem straightforward, but it becomes more complex when considering the fact that a year is not exactly 365 days long. Instead, it is approximately 365.25 days.

I hope you found this tutorial helpful and enjoyable.

Happy coding!

## How To Use Boolean In Excel Vba With Excel Template?

VBA Boolean Operation

In Excel when we compare two cell contents or numbers by applying equal sign between them, we get output in TRUE or FALSE format. Which means values which we are comparing may be equal or may not be equal. In a similar manner, we have Boolean in VBA Excel. Boolean also gives the output in the form of TRUE or FALSE. Boolean is a form of data type which can only contain either TRUE or FALSE. When we give some input to Boolean and if the test becomes TRUE then we get an answer as TRUE or we get FALSE.

How to Use Boolean in VBA Excel?

Let’s see the examples of Boolean in Excel VBA.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

You can download this VBA Boolean Excel Template here – VBA Boolean Excel Template

Example #1 – VBA Boolean

Let’s see a very simple example where we will see how to apply Boolean while comparing some.

Step 2: Now in the opened module, write the sub category of VBA Boolean. We can choose to write any name of subprocedure here.

Code:

Sub

VBABoolean1()

End Sub

Step 3: Now define a Dim with any name, let’ say an A and assign the variable A as Boolean as shown below.

Sub

VBABoolean1()

Dim

A

As Boolean

End Sub

Step 4: Let’s consider two numbers, 1 and 2. And now we will test with the help of Boolean whether 2 is greater than 1 or not. So in the next line, write a mathematical expression of 1<2 under defined variable A.

Code:

Sub

VBABoolean1()

Dim

A

As Boolean

A = 1 < 2

End Sub

Step 5: Now assign a message box to variable A to see what outcome will appear when we run the code.

Code:

Sub

VBABoolean1()

Dim

A

As Boolean

A = 1 < 2 MsgBox A

End Sub

Step 7: If we change the sign as 1 is greater than 2 as shown below. What would we get?

Code:

Sub

VBABoolean1()

Dim

A

As Boolean

MsgBox A

End Sub

Step 8: To test this, again run the code. We will see, Boolean has given FALSE as 1 cannot be greater than 2.

Example #2 – VBA Boolean

In this example, we will test if Boolean works for text or not. To apply this, we need a module.

Step 1: Open a new Module and give it a subcategory in the name of VBA Boolean or any name as per your choice.

Sub

VBABoolean2()

End Sub

Step 2: Define a variable A and assign a Boolean function to it.

Code:

Sub

VBABoolean2()

Dim

A

As Boolean

End Sub

Step 3: Now assign a text to defined variable A. Let’s say that text is VBA Boolean. And it should be under inverted commas.

Code:

Sub

VBABoolean2()

Dim

A

As Boolean

A = "VBA  Boolean"

End Sub

Step 4: At last, give that variable A in a message box to see the output as shown below.

Code:

Sub

VBABoolean2()

Dim

A

As Boolean

A = "VBA Boolean" MsgBox A

End Sub

Step 5: Once done, run the code. We will get an error message as “Run-time error 12 – Type Mismatch” which means that Boolean doesn’t support input as Text.

Example #3 – VBA Boolean

In this example, we will see, if Boolean works for a number without any comparison.

Step 1: Open a new module and give it a subcategory of VBA Boolean as shown below.

Code:

Sub

VBABoolean3()

End Sub

Step 2: Now define a Dim A variable as Boolean as shown below.

Code:

Sub

VBABoolean3()

Dim

A

As Boolean

End Sub

Step 3: As discussed above, we will give the variable A a number. Let’s consider that number is 10.

Code:

Sub

VBABoolean3()

Dim

A

As Boolean

A = 10

End Sub

Step 4: After that, select the function msgbox and assign it to variable A. This will help us print the value with the help of Boolean.

Code:

Sub

VBABoolean3()

Dim

A

As Boolean

A = 10 MsgBox A

End Sub

Step 5: Now run the code. We will get the message with the message as TRUE.

Step 6: Now let’s change that value to 0 from 10.

Code:

Sub

VBABoolean3()

Dim

A

As Boolean

A = 0 MsgBox A

End Sub

Example #4 – VBA Boolean

Step 1: Now, open a new module and write the subcategory of VBA Boolean as shown below.

Code:

Sub

VBABoolean4()

End Sub

Step 2: Now define 2 variable with any name as per your choice. Here, we have selected A and B as Integer. Which means both will store numeric values.

Code:

Sub

VBABoolean4()

Dim

A

As Integer

Dim

B

As Integer

End Sub

Step 3: Now assign any values to variable A and B. Here we have chosen number 1 and 2 for variable A and B as shown below.

Code:

Sub

VBABoolean4()

Dim

A

As Integer

Dim

B

As Integer

A = 1 B = 2

End Sub

Step 4: As stated above, we will use the If-Else loop. Now open the If-End If loop where we will write the criteria.

Code:

Sub

VBABoolean4()

Dim

A

As Integer

Dim

B

As Integer

A = 1 B = 2 If

End If

End Sub

Step 5: Now write the code, If A is less than equal to B then show us the message as TRUE, else show us the message as FALSE.

Code:

Sub

VBABoolean4()

Dim

A

As Integer

Dim

B

As Integer

A = 1 B = 2

If

A <= B

Then

MsgBox

True

Else

MsgBox

False

End If

End Sub

Step 6: Now compile the above code step-by-step and then run if no error found. We will see, the message box has the message as TRUE which means value stored in variable A (which is 1) is less than the value stored in variable B (which is 2).

Pros of VBA Boolean

It is quite useful when we are want to implement the process flow following TRUE and FALSE for each iteration.

Conditional comparison with the help of any kind of loop can easily be implemented.

Cons of VBA Boolean

Only numbers can be used in Boolean. It will show the error if used for text as seen in example-2.

Things to Remember

Using Boolean with any loop will give users a better output. And comparison can be done in various ways.

Boolean is a kind of cell comparison formula used in excel, but it only compares the numerical or mathematical values.

Always save the file in macro enable format to retain the written code to be used in the future.

Recommended Articles

This is a guide to VBA Boolean. Here we discuss how to use Boolean in Excel VBA along with practical examples and downloadable excel template. You can also go through our other suggested articles –

## How To Create Arraylist In Excel Vba With Excel Template?

Excel VBA ArrayList

Data structures are used to store a series of data in programming languages. It binds to the memory rather than address. An ArrayList is one of the data structures in excel. Comparing to normal arrays in excel ArrayList is dynamic. Therefore, no initial declaration of size is needed. ArrayList is not a part of VBA it is associated with an external library which can be used with VBA.

ArrayList can be defined as a list of a nearby memory location. Where the values are retrieved using the index numbers. The list starts from an index number ‘0’, the first element will be inserted into the ‘0’ index and rest is followed by 1, 2, 3, etc. ArrayList offers plenty of built-in operations, sorting, adding, removing, reversing, etc. are some among them.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

To use the ArrayList into the VBA it needs to include the library ‘mscorlib.dll’ which comes with .NET framework.

It will lead you to a window with a list of different libraries which supports in VBA and Excel. Scroll down to find the ‘dll’. Tick mark to confirm the selection then press ‘OK’ button.

Now the library is included in your VBA code and it will support different methods associated with an ArrayList.

How to Create VBA ArrayList in Excel?

You can download this VBA ArrayList Excel Template here – VBA ArrayList Excel Template

Excel VBA ArrayList – Example #1

How to Add Values to the ArrayList using VBA?

ArrayList act as a list where we can add values. This will automatically store in the different portions starting from 0,1, 2, etc. The values can add or insert to the ArrayList using the add method.

In this example, you will learn how to add a list of values into an ArrayList. Follow the below steps to add ArrayList using VBA Code in excel.

Step 1: To add a list of values to an ArrayList create a function arraylist1.

Code:

Private Sub

arraylist1()

End Sub

Step 2: Now we want to include the ArrayList into the function as an object where a list is declared as an ArrayList.

Code:

Private Sub

arraylist1()

Dim

alist

As ArrayList

End Sub

Step 3: Since this is an object to use it, you have to create an instance of the ArrayList. Set a new instance for this object.

Code:

Private Sub

arraylist1()

Dim

alist

As ArrayList

Set

alist =

New

ArrayList

End Sub

Step 4: Now using the ‘Add’ property of an ArrayList adds the values to the ArrayList. Where the list is added into the index values in an order 0,1,2,3 etc.

Code:

Private Sub

arraylist1()

Dim

alist

As ArrayList

Set

alist =

New

'index(0)

'index(1)

'index(2)

'index(3)

End Sub

Step 5: To check whether the values got added into the list, let’s print the array values using a message box. To print the values each index is printed since the values are stored in these partitions.

Code:

Private Sub

arraylist1()

Dim

alist

As ArrayList

Set

alist =

New

'index(0)

'index(1)

'index(2)

'index(3)

MsgBox ("\" & alist(0) & "." & alist(1) & "." & alist(2) & "." & alist(3))

End Sub

Step 6: Press F5 or run button to run the program and the values will be printed as below. Here an IP address is stored in the ArrayList and while printing the values extra notations are concatenated to form the IP address in a proper format.

Automation error in VBA

It is a common error happens while running an ArrayList. An automation error may encounter ‘Run-time Error ‘-2146232576 (80131700) Automation Error’

Excel VBA ArrayList – Example #2

Sorting ArrayList Using VBA Code

ArrayList supports different functions like sorting, reversing, etc. this help to sort the values inserted into an ArrayList. Once you add a list into the ArrayList it is possible to reverse the inserted list.

Follow the below steps to sort the ArrayList using VBA Code:

Step 1: Create a function called arraysort1 to perform the sorting within the inserted values into an ArrayList.

Code:

Sub

arraysort1()

End Sub

Step 2: Declare an object ‘arraysort’ of the ArrayList. Use this object to add and sort the values within the ArrayList.

Code:

Sub

arraysort1()

Dim

arraysort

As ArrayList

End Sub

Step 3: Similar to the first example need to create a new instance of the declared object. Set this instance as a new ArrayList.

Code:

Sub

arraysort1()

Dim

arraysort

As ArrayList

Set

arraysort =

New

ArrayList

End Sub

Step 4: Now using the ‘Add’ method insert the elements to the ArrayList. Which is not possessing any order on values. Randomly inserted some values into the list.

Code:

Sub

arraysort1()

Dim

arraysort

As ArrayList

Set

arraysort =

New

End Sub

Code:

Sub

arraysort1()

Dim

arraysort

As ArrayList

Set

arraysort =

New

ArrayList arraysort.Add "13" arraysort.Add "21" arraysort.Add "67" arraysort.Add "10" arraysort.Add "12" arraysort.Add "45" MsgBox (arraysort(0) & vbCrLf & arraysort(1) _ & vbCrLf & arraysort(2) & vbCrLf & arraysort(3) _ & vbCrLf & arraysort(4) & vbCrLf & arraysort(5))

End Sub

Step 6: Press F5 on the keyboard or run button on the code window to run the program to print the ArrayList. The ArrayList is printed in the same order as it is inserted since we use the index numbers in its correct order.

Step 7: Now to this list apply the sort property of the ArrayList. Use the sort method to sort the inserted list. The sort property will sort the list of values in ascending order by default.

Code:

Sub

arraysort1()

Dim

arraysort

As ArrayList

Set

arraysort =

New

ArrayList arraysort.Add "13" arraysort.Add "21" arraysort.Add "67" arraysort.Add "10" arraysort.Add "12" arraysort.Add "45" arraysort.Sort MsgBox (arraysort(0) & vbCrLf & arraysort(1) _ & vbCrLf & arraysort(2) & vbCrLf & arraysort(3) _ & vbCrLf & arraysort(4) & vbCrLf & arraysort(5))

End Sub

Step 8: Hit F5 or Run button under VBE to run this code, Where the values are sorted and printed in order from smallest value to largest.

Excel VBA ArrayList – Example #3

Reversing the ArrayList using VBA Code

When you want to reverse the order of inserted values in an ArrayList reverse method is available. This will reverse the order of the list from its current order. Now we have already sorted the ArrayList in the previous example, which is in ascending order.

Let’s try to reverse the sorted array to make it descending order. Use the reverse method of ArrayList to do this.

Code:

Sub

arraysort2()

Dim

arraysort

As ArrayList

Set

arraysort =

New

ArrayList arraysort.Add "13" arraysort.Add "21" arraysort.Add "67" arraysort.Add "10" arraysort.Add "12" arraysort.Add "45" arraysort.Sort arraysort.Reverse MsgBox (arraysort(0) & vbCrLf & arraysort(1) _ & vbCrLf & arraysort(2) & vbCrLf & arraysort(3) _ & vbCrLf & arraysort(4) & vbCrLf & arraysort(5))

End Sub

After applying the reverse method, the ArrayList will become in descending order and use the message box to print the reversed array. The sorted list is changed from large value to small value.

Things to Remember

ArrayList is dynamic in nature; it does not require re-initialization.

Different built-in methods are associated with ArrayList.

Compared to the array, ArrayList is easy to use in Excel VBA.

The supporting .NET libraries should be included in the VBA to work with ArrayList.

ArrayList is a continuing memory location which identified using index values.

Recommended Articles

This is a guide to VBA ArrayList. Here we discuss how to create ArrayList in Excel VBA along with practical examples and downloadable excel template. You can also go through our other suggested articles –

## How To Quickly Unhide Columns In Excel

Watch Video – How to Unhide Columns in Excel

If you prefer written instruction instead, below is the tutorial.

Hidden rows and columns can be quite irritating at times.

Especially if someone else has hidden these and you forget to unhide it (or even worse, you don’t know how to unhide these).

While I can’t do anything about the first issue, I can show you how to unhide columns in Excel (the same techniques can also be used to unhide rows).

It may happen that one of the methods of unhiding columns/rows may not work for you. In that case, it is good to know the alternatives that can work.

There are many different situations where you may need to unhide the columns:

Multiple columns are hidden and you want to unhide all columns at once

You want to unhide a specific column (in between two columns)

You want to unhide the first column

Let’s go through each for these scenarios and see how to unhide the columns.

If you have a worksheet that has multiple hidden columns, you don’t need to go hunt each one and bring it to light.

You can do that all in one go.

And there are multiple ways to do this.

Using the Format Option

Here are the steps to unhide all columns at one go:

No matter where that pesky column is hidden, this will unhide it.

Note: You can also use the keyboard shortcut Control A A (hold the control key and hit the A key twice) to select all the cells in the worksheet.

Using VBA

If you need to do this often, you can also use VBA to get this done.

The below code will unhide column in the worksheet.

Sub UnhideColumns () Cells.EntireColumn.Hidden = False EndSub

You need to place this code in the VB Editor (in a module).

If you want to learn how to do this with VBA, read a detailed guide on how to run a macro in Excel.

If you’re more comfortable using keyboard shortcuts, there is a way to unhide all columns with a few keystrokes.

Here are the steps:

Select any cell in the worksheet.

Press Control-A-A (hold the control key and press A twice). This will select all the cells in the worksheet

Use the following shortcut – ALT H O U L (one key at a time)

If you can get hang of this keyboard shortcut, it could be a lot faster to unhide columns.

Note: The reason you need to press A twice when holding the control key is that sometimes when you press Control A, it only selects the used range in Excel (or the area that has the data) and you need to press the A again to select the entire worksheet.

Another keyword shortcut that works for some and not for others is Control 0 (from a numeric keypad) or Control Shift 0 from a non-numeric keypad. It used to work for me earlier but doesn’t work anymore. Here is some discussion on why it may happen. I suggest you use the longer (ALT HOUL) shortcut that works every time.

There are multiple ways you can quickly unhide columns in between selected columns. The methods shown here are useful when you want to unhide a specific column(s).

Let’s go through these one-by-one (and you can choose to use that you find the best).

Using a Keyboard Shortcut

Below are the steps:

Select the columns that contain the hidden columns in between. For example, if you are trying to unhide column C, then select column B and D.

Use the following shortcut – ALT H O U L (one key at a time)

This will instantly unhide the columns.

Using the Mouse

One quick and easy way to unhide a column is to use the mouse.

Below are the steps:

Hover your mouse in between the columns alphabets that have the hidden column(s). For example, if Column C is hidden, then hover the mouse between Column B and D (at the top of the worksheet). You will see a double line icon with arrows pointing on left and right.

Hold the left key of the mouse and drag it to the right. It will make the hidden column appear.

Using the Format Option in the Ribbon

Under the home tab in the ribbon, there are options to hide and unhide columns in Excel.

Here is how to use it:

Select the columns between which there are hidden columns.

Hover the cursor on Hide & Unhide option.

Using VBA

Below is the code that you can use to unhide columns in between the selected columns.

End Sub

You need to place this code in the VB Editor (in a module).

If you want to learn how to do this with VBA, read a detailed guide on how to run a macro in Excel.

There is a possibility that none of these methods work when you try to unhide column in Excel. It happens when you change the Column Width to 0. In that case, even if you unhide the column, it’s width still remains 0, and hence you can’t see it or select it.

Below are the steps to change the column width:

In the name box, type any cell address in that column. For example, if it is column C, type C1.

Although the column is not visible, the cursor would go in between B1 and D1 (indicating that C1 has been selected).

Enter a column width value to make the column visible.

This is by far the most reliable way to unhide columns in Excel. If everything fails, just change the column width.

Unhiding the first column can be a little bit tricky.

You can use many of the methods covered above, with a little bit of extra work.

Let me show you a few ways.

Even when the first column is hidden, Excel allows you to select it and drag it to make it visible.

To do this, hover the cursor on the left edge of column B (or whatever is the leftmost visible column).

The cursor would change into a double arrow pointer as shown below.

Hold the left mouse button and drag the cursor to the right. You will see that it unhides the hidden column.

But how do you go to any cell in the column that’s hidden?

Good question!

You use the Name Box (it’s left to the formula bar).

Enter A1 in the Name Box. It will instantly take you to the A1 cell. Since the first column is hidden, you won’t be able to see it, but be assured that it’s selected (you’ll still see a thin line just left of B1).

Once the hidden column cell is selected, follow the below steps:

Hover the cursor on the ‘Hide & Unhide’ option.

Again! How do you select it when it’s hidden?

Well, there are many different ways to skin the cat.

And this is just another method in my kitty (this is the last cat sounding reference I promise).

When you select the leftmost visible cell and drag the cursor to the left (where there are row numbers), you end up selecting all the hidden columns (even when you don’t see it).

Once you have select all the hidden columns, follow the below steps:

Hover the cursor on the ‘Hide & Unhide’ option.

Excel has an ‘Inspect Document’ feature that is meant to quickly scan the workbook and give you some details about it.

And one of the things that you can do that ‘Inspect Document’ is to quickly check how many hidden columns or hidden rows are there in the workbook.

This might be useful when you get the workbook from someone and want to quickly inspect it.

Below are the steps on how to check the total number of hidden columns or hidden rows:

Open the workbook

In the Document Inspector, make sure Hidden Rows and Columns option is checked.

This will show you the total number of hidden rows and columns.

It also gives you the option to delete all these hidden rows/columns. This can be the case if there is extra data that has been hidden and is not needed. Instead of finding hidden rows and columns, you can quickly delete these from this option.

You May Also Like the following Excel Tips/Tutorials:

Update the detailed information about How To Calculate Time Difference In Excel on the Bellydancehcm.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!