Open In App

How to calculate Sum of Digits in a Number using Non Array Formulas in Excel?

Last Updated: 01 Jul, 2022

E

Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

In Excel, we can easily add the digits of a number. Usually, calculations that involve multiple values can be dealt with the help of array formulas, but here, we are going to find the sum of the digits of a number using non-array formulas. As an example, say we have a number 238 in one of the cells of the Excel sheet and we want to find the sum of the digits of this number. It would essentially be 2 + 3 + 8 which equals 13. Let us see how to do that without using an array formula. But before jumping on to the non-array formula method of finding the sum of the digits of a number, let us first see what is an array formula.

Array Formula

An array formula is nothing but a method that enables one to do multiple calculations at once. It can also do a calculation more than once in a specific cell range. Look at the example below. Say we have to find the product of quantities and cost as shown in the excel sheet below. If we do this using an array formula, then we can get the result much faster. 

Example

 

We can use the multi-cell array formula for multiplying the quantity and cost column.

Multi-cell array formula

Here, we have to use a single formula and we will get results of all the rows. To calculate all the values of the Amount table, we will first select the area where we want to see the end result. Press F2 after selecting the required area so that you come back on to the first cell of the selected area. 

Select-the-required-area-and-press-F2

 

Then, write the array formula in the first cell where the cursor is placed. The formula is simply: =B2:B4*C2:C4

Apply-the-formula

 

Now, don’t just press enter because then it will print the result in only one cell. These formulas are CSE, meaning they will execute properly only when you click CTRL + SHIFT + ENTER. See the result. 

Result

 

Note that Excel automatically adds curly braces around the formula. This is to indicate that it is an array formula. 

Non-array Formula 

There are two non-array formulas that we can use to find the sum of the digits of a number. These are:

  1. Sum and Index Formula
  2. Sumproduct and Indirect Formula

Let us look at them one by one. 

1. Sum and Index formula: Here, we have a number 243 and we have to find the sum of its digits. We will go to the cell in which we want to get the sum and write the following formula:

=SUM(INDEX(1*(MID(A1,ROW(INDIRECT(“1:”&LEN(A1))),1)),,))

This formula uses various functions. Let us understand this formula a bit more:

  • The INDEX function will return the value at a given location. In this case, it would be the value of these numbers. 
  • The MID function will return a sequence of values from the middle of the string. In this case, the string is nothing but the number itself.
  • The ROW function will simply return the number for the referenced. Here the row number will be A1. 
  • The INDIRECT function will return a valid cell reference from this string of numbers. 
  • The LEN function will return the number of characters of the string. In this case, it would be 3. 

Sum and Index formula

Sum-and-Index-formula

 

Just press Enter and you will get the result. 

Final-result

 

 

2. Sumproduct and Indirect Formula: Again we have a number 243 and we have to find the sum of its digits. We will go to the cell in which we want to get the sum and write the following formula:

=SUMPRODUCT(MID(A1,ROW(INDIRECT(“1:” & LEN(A1))),1)*1)

Sumproduct-and-indirect-formula

 

There is one more formula under this category that works the same:

=SUMPRODUCT(MID(A1,ROW(OFFSET($A$1,,,LEN(A1))),1)+0)

It is shown here:

Sumproduct-and-offset-formula

 

Both these formulae give the same output:

Final-result

 

A few more functions are used in this formula. These are:

  • The OFFSET function will return a range specifying a certain number of rows and columns to address a cell. 
  • The SUMPRODUCT function first multiplies a range of cells and then returns the sum of the product. 


E

News
Improve
Discuss
Do you want to advertise with us?Click here to know more

How to calculate Sum and Average of numbers using formulas in MS Excel?

article_img
Everyday in school, offices, business sectors or any other field lots of information are there that are required to store for future use. For anyone, it is very difficult to remember that information for a long time. Earlier data and information are stored in a form of a register, file, or by paperwork but finding it may be difficult for us. It takes a lot of time. To resolve this issue Microsoft brings a software called MS Excel. Microsoft Excel is a software that allows users to store or analyze the data in a proper systematic manner. It uses spreadsheets to organize numbers and data with formulas and functions. MS Excel has a collection of columns and rows that form a table. Generally, alphabetical letters are assigned to columns, and numbers are usually assigned to rows. The point where a column and a row meet is called a cell. Generally, it is used to keep records, data in various fields of business. Features of MS Excel Auto calculate: This helps you to calculate a group of data and it automatically shows the result in the status area You can also create your own formulas.Shared: You can share your data file over a network.Templates: It gives us a variety of elegantly designe
Read More

How to Calculate Average in Excel: Essential Formulas & Examples for 2024

article_img
Whether you're a student crunching numbers for a project, a business analyst examining sales data, or simply someone looking to get insights from personal data, mastering the art of calculating averages in Excel can significantly enhance your data-handling capabilities.In this article, you will learn the basic average functions in Excel along with examples and even touch on some tricks for handling more specific needs.Table of ContentWhy Calculate AveragesHow To Calculate Average Manually in ExcelExcel AVERAGE function Excel AVERAGEA FunctionExcel AVERAGEIF Function Excel AVERAGEIFS FunctionAverage Cells by Multiple Criteria with OR LogicWhy Calculate AveragesCalculating averages is essential for summarizing large sets of data, identifying trends, and making informed decisions. In Excel, there are several functions to help you find averages, each suited to different scenarios. Let’s explore the most commonly used methods and functions.How To Calculate Average Manually in ExcelTo calculate the average without using the AVERAGE function, we can sum all numeric values and divide by the count of numeric values. We can use SUM and COUNT functions like this:= SUM(A1:A5)/COUNT(A1:A5) // m
Read More

How to Calculate Time in Excel: Step by Step Guide with Formulas

article_img
Working with time in Excel can make tasks like tracking hours, calculating time differences, or managing schedules much easier. Excel provides simple tools to calculate time, figure out time differences, and even add or subtract hours using formulas. In this guide, you’ll learn about time formatting, how to do basic and advanced time calculations, and fix common mistakes to keep your data accurate.How to Calculate Time in ExcelTable of ContentUnderstanding Time Formatting in ExcelHow to Enter Time in ExcelBasic Time Calculations in ExcelHow to Add Time in ExcelHow Excel Handles Dates and TimesAdvanced Time CalculationsCommon Errors in Time CalculationsUnderstanding Time Formatting in ExcelExcel stores time as a fraction of a 24-hour day. For instance:0.25 represents 6:00 AM (6 hours).0.5 represents 12:00 PM (12 hours).0.75 represents 6:00 PM (18 hours).Before starting, ensure your cells are formatted correctly:Select the cells containing time values.Right-click and choose Format Cells.In the Format Cells dialog box, select Time or Custom and set the desired format (e.g., hh:mm:ss).How to Enter Time in ExcelExample Format: Enter time as hh:mm (e.g., 08:30 for 8:30 AM).For AM/PM, typ
Read More

Array Formulas in Excel

article_img
Excel is among the most powerful and widely used spreadsheet tools which eases organizing numbers and data within the sheets with pre-built formulas and functions. In this article, we are going to study Array Formulas. Arrays are one of them. Using Excel Array Formulas, make it super easy to handle a lot of data. Before understanding and using the Array formulas, let's first understand what is Array in Excel? Array in ExcelAn Array in Excel is the structure that holds a collection of data. These data can be in the form of numbers or texts. There could be an array of 1-D or 2-D as well in Excel. For example, the array of fruits in excel would be written something like this:- {"Apple", "Banana", "Grapes", "Guava"} We can directly enter it into the sheet by selecting the cells where you want to enter the data and then writing the array preceded by an "=" sign. After these press Ctrl+Shift+Enter. For example, let's enter these values in cells A1 to D1. The array created here is a horizontal array. You can also create a vertical array by changing the selected cells. You can create an array by specifying the starting and the ending positions, for example, if you wish to make an array o
Read More

Dynamic Array Formulas in Excel

article_img
Dynamic arrays are resizable arrays that calculate automatically and return value into multiple cells based on a formula entered in a single cell. The new array (multiple cells) that we get is known as spilling and the new array has been placed in neighboring cells. It is not necessary to use Ctrl + Shift + Enter to enter an array formula. Dynamic array formulas are only available in Excel 365 and Excel 2021. Dynamic Array Formulas Below mentioned array formulas are the dynamic array formulas, let's learn in detail how these formulas are applied in excel on a certain dataset. UNIQUESORTSORT BYSEQUENCERANDARRAYFILTERLOOKUP UNIQUE Formula Unique formulas return a list of unique values in a list. Unique means that element that appears only once in an array. Values can be text, number, etc. A unique function is not case-sensitive means 'Apple' and 'apple' are the same. Syntax, =UNIQUE(A3:A17) fig 1. Print only Unique Values SORT Formula Sort formula returns a list in increasing order or decreasing order. Values can be text, number, etc. Syntax, =SORT(A4: A10) increasing order. fig 2. Sort the values SORTBY Formula SORTBY formula sorts the contents of a range based on values from
Read More

How to Lock Formulas in Excel

article_img
Are you tired of accidentally altering formulas in your Excel spreadsheets? Locking formulas in Excel is essential for maintaining the integrity of your data and ensuring that your calculations remain accurate. In this comprehensive article, you will learn the effective techniques to protect your Excel formulas from unintended changes, helping you keep your data secure. From understanding cell references to utilizing the $ shortcut for absolute references, we’ll cover everything you need to know. Whether you’re a beginner or an advanced user, mastering how to lock formulas will enhance your productivity and data management skills. Let’s get into the straightforward process of locking your Excel formulas and safeguarding your valuable calculations!In this article, we will discuss how to lock and protect the formulas within the Excel sheet along with an example.Lock Formulas in Excel Table of ContentUnderstanding Cell ReferencesHow to Lock Formula in Excel with Dollar Sign How to Lock Formulas in Excel Without Protecting the Workbook How to Lock Formulas in Excel shortcutHow to Remove Protection and Unhide Formulas in ExcelUnderstanding Cell ReferencesBefore we explore the $ shortcut
Read More

How to Show Formulas in Excel

article_img
Exploring the art of Excel formulas can turn up your data analysis and reporting capabilities. Whether you’re a financial analyst, digital marketer, or an Excel learner, understanding how to display formulas in Excel is important. This article will make you learn the simple steps to show the formulas of your Excel spreadsheets, enhancing your efficiency and proficiency. By learning how to show formulas in Excel, you’ll learn to ensure accuracy and transparency in your calculations. How to Show Formulas in ExcelHow to Show Formulas in MS Excel When you enter a formula in a cell and press the Enter key, Excel immediately displays the calculated result. To check all the formulas in the cell, follow one of the methods provided below for your reference, Show the Formulas Option on the Excel RibbonThe Ribbon: Head over to the Formulas tab, find the Formula Auditing section, and hit the Show Formulas button. Your formulas will step into the spotlight, replacing the results on stage. To get the calculated values back, click the Show Formulas button again to toggle it off. Go to Formulas Tab>> Select Show formulas Show Formulas in cells instead of their results in Excel optionsIn Exce
Read More

Basic Excel Formulas

article_img
Functions in Excel are the predefined formulas that have their specific meaningful work. They make our task easy and quick like finding the sum, count, average, maximum value, and minimum values for a range of cells. For example, the SUM function will calculate the sum of the range passed to it as an argument. Functions increase productivity while working in Excel. Basic Functions in Excel We have data on Vegetables used in 1 week in a house, and we find the total cost of vegetables. Now, we'll apply basic Excel Functions on the data. Sum(): It adds all the values in a range of cells. =SUM(C3:C8) will find sum of values given in the range from C3 to C8.Max(): It will find the maximum value in the given range of values.Max value from C5 to C12 is 80.Min(): It will find the minimum value in the given range of values.MIn value from C5 to C10 is 12.Average(): It calculates the average value in a range of cells.Count(): It will count the number of cells in a range of cells.Len(): It will return the number of characters in a string text.Sumif(): It Adds all the values in a range of cells that meet a specified condition. = SUMIF(range,criteria,[sum_range]).AverageIf():- It Calculates the
Read More

Top Excel Formulas and Functions You Should Know 2024

article_img
In the ever-evolving world of data analysis, mastering the top Excel formulas and functions is essential for maximizing productivity and efficiency. As we move into 2024, Excel remains a cornerstone tool for professionals across industries, from finance to marketing so for a better output you have to learn using Excel formulas. Whether you're a seasoned analyst or a beginner, exploring the excel formula list below will significantly boost your data handling capabilities.From the indispensable VLOOKUP and INDEX MATCH to the versatile XLOOKUP and FILTER, these formulas are designed to streamline your workflow and enhance data accuracy. Imagine effortlessly summarizing data with SUMIFS, managing conditional logic with IF and IFS, or performing complex calculations with ARRAYFORMULA. These essential Excel formulas are not just tools but gateways to smarter, faster, and more reliable data management.Table of ContentExcel Formulas vs FunctionsWhat is Excel FormulaWhat is an Excel Function How to Use Functions in ExcelHow to Use Formulas in ExcelDifference Between Formula and Functions in ExcelExcel Formulas and Functions with Examples1. Excel SUM Formula2. Excel SUBTRACTION Formula3. Exc
Read More

6 New Functions or Formulas in Excel 2019

article_img
A formula is a mathematical expression that computes a cell's value. Functions are predefined formulas found in Excel. Based on the values specified as arguments or parameters, functions perform specific calculations in a specific order. For instance, =SUM (C1:C10). This function adds the values from cells C1 to C10. In the math and trigonometry, statistical, engineering, date and time, lookup and reference, logical, and text function categories, several new functions are added. In addition, the Web category is introduced, along with a few Web service features. Some Basic functions in Excel were discovered earlier that can be used to perform basic operations. We also have a Statistical function in Excel that can be used in industries and businesses for better and more effective results. Categories of FunctionsExcel functions are classified according to their functionality. If you know the category of the function you're looking for, you can select it. Step 1: Select the FORMULAS tab. The group Function Library appears. The function categories are contained within the group. Step 2: Navigate to the More Functions tab. More function categories will be shown. Step 3: Select a funct
Read More
three90RightbarBannerImg