+ Reply to Thread
Results 1 to 4 of 4

Decimal not displaying as desired

  1. #1
    Registered User
    Join Date
    12-11-2012
    Location
    San Mateo
    MS-Off Ver
    Excel 2016
    Posts
    16

    Decimal not displaying as desired

    I have solar panels on the house and am running a spread sheet on various totals. What I want to do is get an average monthly production number with 2 decimal places and what I get is 1 or 14 and using the following formula:

    =SUMIF(B307:B336,">0")/COUNTA(B307:B336)&" kWh"

    I have the Format Cells | Number set to two and the Sample doesn't even change. I've tried adding a ROUND command and changing the decimal from withing the formula with no luck. If I leave it at 0 I get 1 decimal place, any other number I get the 14.

    =ROUND(SUMIF(B337:B367,">0"),0)/COUNTA(B337:B367)&" kWh
    ---------------------------------------^

    At the top of the sheet I have yearly totals and an average daily output and they work fine. I'd attach the file but I don't think I'm authorized. I have upgraded to Office 2016.
    ~Dave
    Last edited by JOB Dave; 12-17-2017 at 06:09 PM. Reason: Update Prefix

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Decimal not displaying as desired

    Quote Originally Posted by JOB Dave View Post
    What I want to do is get an average monthly production number with 2 decimal places and what I get is 1 or 14 and using the following formula:
    =SUMIF(B307:B336,">0")/COUNTA(B307:B336)&" kWh"
    =TEXT(SUMIF(B307:B336,">0")/COUNTA(B307:B336),"0.00") &" kWh"

    Quote Originally Posted by JOB Dave View Post
    I have the Format Cells | Number set to two
    Numeric formats apply only to numeric values. Your formula returns text. We can enter text into a cell that has a numeric format. The type of the cell value is still text.

    PS: If you are saving the file as something other than "xls" (Excel 2003 compatible), perhaps the following does what you want:

    =TEXT(AVERAGEIF(B307:B336,">0"),"0.00") &" kWh"

    Both formulas assume that there is at least one value greater than zero. Otherwise, use IFERROR to avoid a #DIV/0 error.
    Last edited by joeu2004; 12-17-2017 at 05:21 PM. Reason: errata

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Decimal not displaying as desired

    Quote Originally Posted by joeu2004 View Post
    =TEXT(SUMIF(B307:B336,">0")/COUNTA(B307:B336),2) &" kWh"
    Doh! That should be:

    =TEXT(SUMIF(B307:B336,">0")/COUNTA(B307:B336),"0.00") &" kWh"

    (Corrected the original.)

  4. #4
    Registered User
    Join Date
    12-11-2012
    Location
    San Mateo
    MS-Off Ver
    Excel 2016
    Posts
    16

    Re: Decimal not displaying as desired

    Quote Originally Posted by joeu2004 View Post
    Doh! That should be:

    =TEXT(SUMIF(B307:B336,">0")/COUNTA(B307:B336),"0.00") &" kWh"

    (Corrected the original.)
    That seems to work just fine, Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] need help displaying desired rows based on Yes and No question for multiple categories
    By DixieDoll11 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-07-2014, 01:48 PM
  2. [SOLVED] Formula not returning desired number of digits after decimal, add text
    By Russ Fuquay in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-25-2013, 01:39 PM
  3. comparing cells and displaying the desired value
    By phil@micro in forum Excel General
    Replies: 2
    Last Post: 01-23-2009, 05:32 AM
  4. Rounding up to desired decimal value
    By sajanjiv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-04-2008, 11:01 PM
  5. [SOLVED] Time displaying as decimal
    By MauroBCT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2005, 05:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1