+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    12-19-2009
    Location
    Honolulu, HI
    MS-Off Ver
    Excel 2007
    Posts
    1

    Rounding Multiple If statements

    Background: I have a drop down box that allows you to check what type of fuel you're using for water heating.
    If it's one, then it will calc the number (true) and label it accordingly, if the other (false) it will label it accordingly as well.
    My problem is that once I added the labeling part to the formula, the numbers no longer round to the nearest whole number, which is what I need.

    =IF(E3="LP",M3/(100000*I3),M3/(3413*I3))&IF(E3="LP"," Therms"," kWh")

    E3 is my fuel (LP,ELEC)
    I3 is % in decimal form.
    M3 is any number (usually in the millions)

    Please help.
    Mahalo

  2. #2
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Akron, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: Rounding Multiple If statements

    You will be asked to put your code into code brackets. You can try this:

    Code:
    =ROUND(IF(E3="LP",M3/(100000*I3),M3/(3413*I3)),0) &IF(E3="LP"," Therms"," kWh")

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007
    Posts
    6,259

    Re: Rounding Multiple If statements

    What code?
    Dave


  4. #4
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,441

    Re: Rounding Multiple If statements

    You don't necessarily need an array formula, but could simply insert the ROUND function into your existing formula.
    =IF(E3="LP",ROUND(M3/(100000*I3),0),ROUND(M3/(3413*I3),0))&IF(E3="LP"," Therms"," kWh")
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0