๐ŸŒ
Excel Forum
excelforum.com โ€บ excel-formulas-and-functions โ€บ 1208669-mode-formula-not-working-as-expected.html
MODE formula not working as expected [SOLVED]
Try this in V2: =IFERROR(MODE(IF(L$2:L$402=U2,M$2:M$402)),INDEX(M$2:M$402,MATCH(1,IF((L$2:L$402=U2)*(M$2:M$402<>""),1),0))) Ctrl Shift Enter If there is no mode (but there is a number), the formula will return the first matched number. If there is no mode and there is no number, the formula ...
๐ŸŒ
Microsoft Support
support.microsoft.com โ€บ en-us โ€บ office โ€บ mode-function-e45192ce-9122-4980-82ed-4bdc34973120
MODE function - Microsoft Support
Arguments that are error values or text that can't be translated into numbers cause errors. If the data set contains no duplicate data points, MODE returns the #N/A error value. The MODE function measures central tendency, which is the location of the center of a group of numbers in a statistical ...
๐ŸŒ
Reddit
reddit.com โ€บ r/excel โ€บ my mode(if formula is returning #n/a no matter what i try.
r/excel on Reddit: My mode(if formula is returning #N/A no matter what I try.
February 7, 2019 -

I'm trying to create a mode if formula. I have an array of data for which I'm looking for the mode of certain variables. Basically, I'm looking to create a table using the mode values for the criteria.
I have tried using the following function: =MODE(IF([DATA ARRAY]=COMPARATIVE VALUE,DATA))
But, I have been unable to get it to work, despite using ctrl, shift, enter.
I need help to figure this out.

๐ŸŒ
Excel Functions
excelfunctions.net โ€บ excel-mode-function.html
Excel MODE Function
In Excel 2010, the MODE function has been replaced by the MODE.SNGL function. Although it has been replaced, current versions of Excel still have the Mode function (stored within the list of compatibility functions), to allow compatibility with earlier versions of Excel. However, the Mode function may not be available in future versions of Excel, so it is advised that you use the MODE.SNGL function if possible.
๐ŸŒ
MrExcel
mrexcel.com โ€บ forums โ€บ question forums โ€บ excel questions
MODE not working with named range | MrExcel Message Board
June 17, 2021 - If I use MODE without the named range by dragging over the data (need to use CTRL as I drag because the data is not contiguous), it ... Appears MODE doesn't work with non-contiguous named ranges. You can write a custom function as a workaround.
๐ŸŒ
MrExcel
mrexcel.com โ€บ forums โ€บ question forums โ€บ excel questions
Mode.Mult Function not working | MrExcel Message Board
March 15, 2017 - But there is only one modal value in that set, i.e. 4 (which occurs 4 times - no other value occurs that number of times). Perhaps you misunderstood the function MODE.MULT? It will only return more than one value if there are several values which share the mode.
๐ŸŒ
TechOnTheNet
techonthenet.com โ€บ excel โ€บ formulas โ€บ mode.php
MS Excel: How to use the MODE Function (WS)
If all numeric values in the set are unique, the MODE function returns the #N/A error. If a text value such as "A" is entered as a parameter, the MODE function will return the #VALUE! error. If a range or cell reference contains non-numeric values such as text values, logical values or empty cells, these values will be ignored. See also MODE.SNGL and MODE.MULT functions. Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003
๐ŸŒ
Corporate Finance Institute
corporatefinanceinstitute.com โ€บ home โ€บ resources โ€บ mode function
MODE Function - Overview, Formula, Example
October 10, 2023 - In Excel 2010, the MODE function was replaced by the MODE.SNGL function. Although itโ€™s been replaced, current versions of Excel still provide the MODE function to allow compatibility with earlier versions. It is stored within the list of compatibility functions. However, the MODE function may not be available in future versions of Excel, so it is advised that you use the MODE.SNGL function whenever possible.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ answers โ€บ questions โ€บ 40d7cbc7-f98a-41db-ac3f-39188a1cfc77 โ€บ problems-with-mode-formula-in-excel
Problems with Mode formula in Excel - Microsoft Q&A
I believe I have formulas that will work for you. ... In the max rows, Row 13, 27, etc. I used: ... Both of these formulas will result in #N/A if there is no data in the Row/Column. That is good. The MODE formulas will replace those with "" so that they will not be counted.
Find elsewhere
๐ŸŒ
Keynote Support
keynotesupport.com โ€บ excel-functions โ€บ mode-function.shtml
How to Use the MODE Function of Microsoft Excel
Example 2: =MODE(A8,A7,A6,A5,A4,A3,A2) โ€” We entered this MODE function in cell B5, listing the cell addresses individually and in a different order, and Excel returned a mode of 8 because it was the first mode it encountered. If multiple modes are expected, the MODE function is not very useful.
๐ŸŒ
The Bricks
thebricks.com โ€บ resources โ€บ how-to-use-the-mode-function-in-excel-a-step-by-step-guide
How to Use the MODE Function in Excel: A Step-by-Step Guide
MODE: This is an older "compatibility" function from Excel 2007 and earlier. While it still works, Microsoft recommends using MODE.SNGL instead for greater accuracy and consistency with modern versions of Excel.
Top answer
1 of 5
10

Jennie wrote:

=MOD((15*(1,4-1));6)

returns 6,0 and

=MOD((15*(0,4));6)

returns 0,0

I would like the first MOD function to return 0 as well. Is there a reason why Excel behaves like this?

Yes.  It is explained in overwhelming detail in http://support.microsoft.com/kb/78113.

In a nutshell, the problem is due to the fact that Excel (and most applications) uses binary floating-point to represent numbers.  Consequently, most non-integers (and integers greater than 2^53) cannot be represented exactly.  The usually-infinitesimal differences sometimes become noticable after some arithmetic operations.

In your case, 1.4 is represented as 1.39999999999999,9911182158029987476766109466552734375, so 1.4-1 is represented as 0.399999999999999,911182158029987476766109466552734375.  The result of multiplying by 15 is represented as 5.99999999999999,82236431605997495353221893310546875.

Note:  Because Excel displays only the first 15 significant digits, rounding the 16th, these intermediate results will display as 1.40000000000000, 0.40000000000000 and 6.00000000000000.  But they really aren't.  You can verify this by entering, for example, =A2-0.4-0 formatted as General, where A2 contains =1.4-1.  The redundant -0 is needed to avoid the dubious heuristic poorly described under the misleading title "Example When a Value Reaches Zero" in KB 78113.  In short, sometimes Excel forces an arithmetic result to be exactly zero if it thinks the result is "close enough" to zero.

In contrast, the constant 0.4 is represented by 0.400000000000000,02220446049250313080847263336181640625.  By coincidence, multipying by 15 results in exactly 6.  But I empahsize:  that is only by coincidence.

The general solution is to explicitly round expressions to the precision that your require.  For example:

=MOD(ROUND(15*(1.4-1),2),6)

if you required accuracy to 2 decimal places.

Jennie wrote:

> I did not experience the same problem in office 2003

I am using XL2003 for all of my work above.  So yes, the same problem exists in XL2003.

You might not have seen it in XL2003 because instead of those exact constants, you were working with the results of other arithmetic operations which only appeared to have results like those constants.  Alternatively, you might have been working with very different constants.  Each arithmetic situation is a little different.  It is very difficult to predict which combinations of numbers will exhibit these floating-point anomalies.

2 of 5
0

This does appear to be a bug - probably the result of the "improved accuracy" of the MOD function in Excel 2010... :-(

๐ŸŒ
Excel Easy
excel-easy.com โ€บ examples โ€บ mode.html
MODE function in Excel - Step by Step Tutorial
Note: the formula bar indicates that this is an array formula by enclosing it in curly braces {}. To delete this array formula, select the range A8:A10 and press Delete. In this example, there are only two modes (5 and 8) so we could have selected two cells at step 5. ... 9. The MODE function only works with numbers.
๐ŸŒ
ExcelMojo
excelmojo.com โ€บ home โ€บ mode excel function
MODE Excel Function - Formula, Examples, How to Use?
June 20, 2025 - The MODE function in Excel may not work because of the below reasons: โ€ข The MODE() arguments are not numeric values. โ€ข The MODE() arguments contain error values or texts that do not translate into numeric values.
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ mode-function-in-excel
MODE() Function in Excel: Find the Most Frequent Number | DataCamp
August 8, 2025 - Itโ€™s important to note that MODE() only works with numbers. If your data includes text or empty cells, Excel will simply skip over those entries.
๐ŸŒ
Exceljet
exceljet.net โ€บ mode function
Excel MODE function | Exceljet
November 24, 2021 - The Excel MODE function returns the most frequently occurring number in a numeric data set. For example, =MODE(1,2,4,4,5,5,5,6) returns 5. ... A number representing the mode. ... The MODE function returns the most frequently occurring number in a set of numeric data. If supplied data does not contain any duplicate numbers, the MODE function returns a #N/A error.
๐ŸŒ
Formulas HQ
formulashq.com โ€บ how-to-use-the-excel-mode-function-2
How to use the Excel MODE function - FormulasHQ
October 10, 2024 - ... Note: the formula bar indicates ... modes (5 and 8) so we could have selected two cells at step 5. ... 9. The MODE function only works with numbers....
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 37854221 โ€บ mode-ifs-in-excel-applying-criteria-to-mode-function-and-excluding-a-number-fr
arrays - MODE IFS in excel - applying criteria to MODE function and excluding a number from the series - Stack Overflow
I am using MODE IF in Excel, which seems to work fine, but I need it to exclude from the MODE all number 2's. The Formula I am using is as follows: =IFERROR(MODE(IF($I:$I=I4,$K:$K)),K4) entered w...