filmov
tv
Excel Display Only Last 4 Of Social Security Number - Episode 2618
Показать описание
Microsoft Excel Tutorial: Hiding part of Social Security Number
Welcome to Episode 2618 of MrExcel's netcast, where we tackle the question of how to display only the last four digits of a Social Security number in Excel. This is a common issue for those of us in the United States, where we all have a Social Security number with three digits, two digits, and four digits. The VA has figured out that the last four digits, combined with your last name, are enough to verify your identity. But what if we only need to see the last four digits in our Excel report, while keeping the full number available just in case? In this episode, we explore two solutions to this problem.
The first solution involves using VBA to create a macro that will obscure the Social Security numbers in the selected column. This macro will replace the original number with a formula that displays only the last four digits, while still retaining the full number in the formula bar. This solution requires VBA and will only work on Windows or Mac versions of Excel. However, it does not require any additional data or changes to the original data set.
The second solution utilizes the data types feature introduced in Excel 2018. By creating a data type for the last four digits of the Social Security number, we can display only those digits in our report while still having access to the full number if needed. This solution does not require VBA and can be used on Windows, Mac, or Excel Online. However, it does require some additional steps in Power Query to split the original data and create the data type.
I understand that these solutions may not be ideal for everyone, and I am always open to hearing about better ways to solve this problem. If you have a different solution or any questions or comments, please leave them in the comments section below. And as always, if you enjoy these videos, please like, subscribe, and ring the bell to be notified of future episodes. Thank you for watching, and I'll see you next time for another netcast from MrExcel.
Someone from the Veterans Administration is getting data downloaded that includes the entire social security number (SSN). They only want to display the last four of the SSN. But, sometimes, they need to be able to go back and see the entire SSN.
I have two solutions today, but I bet you have something better.
First, it would be nice if Excel offered a custom number formatting code that said "There is a digit here, but we don't want to display it".
My first solution is a pair of VBA macros that embed the original SSN in the N() function in Excel.
The second solution runs the data through Power Query, creating a data type that displays the Last 4 of SSN, but offers a card with the full SSN.
Table of Contents
(0:00) Problem Statement Display last 4 of SSN
(1:08) Using RANDBETWEEN for SSN
(1:35) Excel Custom Number Format Idea to obscure a character
(2:06) Special number format for Social Security Number
(2:25) @@@@ Number Format repeats text four times!
(2:57) VBA Solution
(3:30) Excel N() function for including a comment in a cell
(4:30) Macro to bring back SSN
(5:13) Including quoted text in Excel VBA
(5:35) INSTR function in Excel VBA to find text
(6:15) Testing the Reveal Macro
(6:30) Data Types in Power Query
(9:30) Wrap-up
Welcome to Episode 2618 of MrExcel's netcast, where we tackle the question of how to display only the last four digits of a Social Security number in Excel. This is a common issue for those of us in the United States, where we all have a Social Security number with three digits, two digits, and four digits. The VA has figured out that the last four digits, combined with your last name, are enough to verify your identity. But what if we only need to see the last four digits in our Excel report, while keeping the full number available just in case? In this episode, we explore two solutions to this problem.
The first solution involves using VBA to create a macro that will obscure the Social Security numbers in the selected column. This macro will replace the original number with a formula that displays only the last four digits, while still retaining the full number in the formula bar. This solution requires VBA and will only work on Windows or Mac versions of Excel. However, it does not require any additional data or changes to the original data set.
The second solution utilizes the data types feature introduced in Excel 2018. By creating a data type for the last four digits of the Social Security number, we can display only those digits in our report while still having access to the full number if needed. This solution does not require VBA and can be used on Windows, Mac, or Excel Online. However, it does require some additional steps in Power Query to split the original data and create the data type.
I understand that these solutions may not be ideal for everyone, and I am always open to hearing about better ways to solve this problem. If you have a different solution or any questions or comments, please leave them in the comments section below. And as always, if you enjoy these videos, please like, subscribe, and ring the bell to be notified of future episodes. Thank you for watching, and I'll see you next time for another netcast from MrExcel.
Someone from the Veterans Administration is getting data downloaded that includes the entire social security number (SSN). They only want to display the last four of the SSN. But, sometimes, they need to be able to go back and see the entire SSN.
I have two solutions today, but I bet you have something better.
First, it would be nice if Excel offered a custom number formatting code that said "There is a digit here, but we don't want to display it".
My first solution is a pair of VBA macros that embed the original SSN in the N() function in Excel.
The second solution runs the data through Power Query, creating a data type that displays the Last 4 of SSN, but offers a card with the full SSN.
Table of Contents
(0:00) Problem Statement Display last 4 of SSN
(1:08) Using RANDBETWEEN for SSN
(1:35) Excel Custom Number Format Idea to obscure a character
(2:06) Special number format for Social Security Number
(2:25) @@@@ Number Format repeats text four times!
(2:57) VBA Solution
(3:30) Excel N() function for including a comment in a cell
(4:30) Macro to bring back SSN
(5:13) Including quoted text in Excel VBA
(5:35) INSTR function in Excel VBA to find text
(6:15) Testing the Reveal Macro
(6:30) Data Types in Power Query
(9:30) Wrap-up
Комментарии