How to Sum Random Cells in Excel

We want to calculate the Total Sales of the Sales Representative Abigail from the Sales Report shown below.

Overview of How to Sum Random Cells in Excel

Note: We have used Office 365 when preparing this article. However, you can apply the below methods in all versions available in Excel.


Method 1 – Using Simple Arithmetic Calculations to Sum Random Cells in Excel

We have a dataset of January sales containing Date, Sales Rep, and Sales columns. We have sales amounts for sales representatives with their respective dates of sale. We want to sum up the total January sales of Abigail.

January Sales Data

Steps:

  • Select cell F9 and write an equal (=) sign, then click on the cells that contain the sales amount of Abigail and separate each of those values by a plus (+) sign.
  • The formula will look like:
=D5+D9+D10+D14+D16

Using Simple Arithmetic Formula to Sum Random Cells

  • Press Enter.

Sum of Random Cells with Arithmetic Formula


Method 2 – Applying the SUM Function to Sum Non-Contiguous Cells in Excel

Steps:

  • To get the result in cell F9, select the cell and insert the SUM function.
  • Inside the SUM function, reference the cells containing the sales amount of Abigail. Separate each cell reference with a comma (,). So, the formula will look like:
=SUM(D5,D9,D10,D14,D16)

Using SUM Function to Sum Random Cells

  • Press Enter and you will get your desired result.

Sum of Random Cells with SUM Function


Method 3 – Using the AutoSum Feature

Steps:

  • Select the cell where you want your sum result (cell F9 here).
  • Go to the Home tab and the Editing group, then select the AutoSum option.

Accessing AutoSum Feature

  • This will automatically insert the SUM function in the formula bar.
  • Reference the cells containing Abigail’s sales like before with separated commas. This will result in the following formula:
=SUM(D5,D9,D10,D14,D16)

Using AutoSum Feature to Sum Random Cells

  • Press Enter. You will get your desired sum result of random cells.

Sum of Random Cells with AutoSum Feature


Method 4 – Applying Named Ranges to Sum Random Cells in Excel

Steps:

  • Hold the Ctrl key on your keyboard.
  • Select cells that contain Abigail’s sales.
  • Write “Abigail” in the Excel Name Box.

Naming Range of Random Cells

  • Pressing Enter will convert those cells into a named range “Abigail”.
  • Select your desired output cell (Cell F9 here) and insert the following formula.
=SUM(Abigail)

 Sum Formula with Named Range

  • Press Enter and you will get your desired result which is $31409.15.

Sum of Random Cells with Named Range


Method 5 – Using the Insert Function Button to Sum Random Cells in Excel

Steps:

  • Select the desired output cell (Cell F9 here).
  • You will find an fx button beside the formula bar.

Accessing Insert Function Button

  • Click on the fx button and you will get an Insert Function dialog box.
  • Select SUM from the options available in the Select a function: options.

Insert Function Dialogue Box

  • Click on the OK button and you will get another window named Function Arguments.
  • In the Number1 text box, insert the first cell reference of Abigail’s sales amount.
  • Similarly, insert all the cell references of Abigail’s sales one by one in each number text box.

Function Arguments Dialogue Box

  • Click on the OK button and you will get your desired sum result.

Sum of Random Cells with Insert Function Button


Method 6 – Using the Subtotal Tool to Sum Non-Contiguous Cells in Excel

Steps:

  • Create a new column named Abigail Sales and insert the following formula in cell E5.
=IF(C5="Abigail",D5,"")

Using IF Function to Find Only Abigail's Sales

  • Press Enter.
  • Place your cursor in the bottom-right corner of cell E5 and you will find Excel’s fill handle.

Using Fill Handle to Copy Formula

  • Drag the fill handle down and you will get all the sales amount of Abigail in column E.
  • Select cells D4:E19.
  • Go to the Data tab and select the Subtotal tool.

Accessing Subtotal Tool

  • You will get a Subtotal dialog box.
  • Choose Abigail Sales in the At each change in: dropdown.
  • Choose Sum in the Use function: dropdown.
  • Select the Abigail Sales checkbox in the Add Subtotal to: options.

Subtotal Dialogue Box

  • Click on the OK button.

Subtotal of Abigail's Sales


Method 7 – Applying the SUMIF Function to Sum Random Cells Based on Criteria in Excel

Steps:

  • To find the total sales of Abigail in cell F9, insert the following formula.
=SUMIF(C5:C19,"Abigail",D5:D19)

SUMIF Function to Sum Random Cells

  • Press Enter and you will get the total sales of Abigail.

Sum of Random Cells Based on Criteria


Method 8 – Summing Random Cells Across Multiple Sheets in Excel

We have our initial January sales data and now also February sales data. We want to get total sales of Abigail for the months of January and February.

February Sales Data

Steps:

  • To get the result in cell F9, select the cell and insert the following formula.
=SUM('January Data'!D5,'January Data'!D9,'January Data'!D10,'January Data'!D14,'January Data'!D16,'February Data'!D9,'February Data'!D12,'February Data'!D15)

Formula to Sum Random Cells Across Multiple Sheets

  • In the formula, all the cells of Abigail’s sales from January Data sheet and February Data sheet are referenced.
  • Pressing Enter will find the sum of Abigail’s sales for January and February.

Sum of Random Cells Across Multiple Sheets


Method 9 – Summing Random Cells to Get a Certain Value in Excel

We have a specific target value and we want to achieve that target value with randomly generated values.

Steps:

  • Insert your target value (50,000 here) in the desired cell (cell E9 here).
  • To generate a random value in cell B5, insert the following formula with the RAND function.
=RAND()

Generating Random Value

  • Hover over the fill handle for B5.

Using Fill Handle to Copy Same Formula

  • Drag the fill handle down and you will get random values in cells B5:B19.
Note:

As these are randomly generated values, the values will change randomly every time you do any operation with these cells. So, to make the random values constant, you need to copy and paste values.

  • Select all the cells (B5:B19 here) and press Ctrl + C key to copy the cells with the formula.

Copying Random Values with Formula

  • Right-click on the selection and select Values from the Paste Options: of the context menu.

Pasting Only Values

  • This converts the values to constants.

Random Values

  • Click on cell C5 and insert the following formula.
=B5/SUM($B$5:$B$19)*$E$9

Formula to Adjust Random values

  • Press Enter and the random value of cell B5 will be adjusted to a value based on all random values present.

Using Fill Handle to Copy Same Formula

  • Drag the fill handle down and you will find all the adjusted values of the present random values. If you sum these values, you will get your desired total of 50000.

Adjusted Random Values to Get Certain Result


Download the Practice Workbook


Related Articles


<< Go Back to Sum in Excel | Calculate in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Chinmoy Mondol
Chinmoy Mondol

Chinmoy Mondol is a computer engineer who loves exploring Excel and VBA programming. Programming, to him, is a time-saving tool for efficiently managing data, files, and internet tasks. He is proficient in C, C++, Python, JavaScript, HTML, SQL, MySQL, PostgreSQL, Microsoft Office, and VBA and goes beyond the basics. He holds a B.Sc. in Computer Science and Engineering from American International University-Bangladesh. He has transitioned into the role of a content developer. Beyond his work, find him immersed... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo