+ Reply to Thread
Results 1 to 8 of 8

IF formula not accepting 1?

  1. #1
    Registered User
    Join Date
    08-06-2013
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    72

    IF formula not accepting 1?

    Hello,

    I posted this question yesterday:

    I have a formula =E4*1.05/((D4*40*5.1))

    The problem is, if there's nothing in the D cell then it errors out. However, I don't want to set it to a zero or anything....I'd actually like to remove that part of the equation if there's nothing in the D cell. For example, there's an error now because there's nothing in D4...but if you alter the formula to =E4*1.05/((40*5.1)) then it provides what I believe is correct. Does this make sense? Is there any way to say if there's an error ignore D4, or else use the new forumula?


    Someone supplied what looked like a good solution: =IF(D4="",E4*1.05/(40*5.1),E4*1.05/(D4*40*5.1))

    The problem is, whether I enter a 1 in D4 or enter nothing, the cell with the formula remains the same. It only changes once I enter a 2, 3 etc. That shouldn't be, because even 1 (which would be 204), would have an impact, right? Basically, if I use a one and E4 only has 60 the cell with teh formula stays the same....which isn't right.

    Does this make sense? Can anyone help?

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: IF formula not accepting 1?

    Hi, try:
    =E4*1.05/if(D4="",1,D4*40*5.1)

  3. #3
    Registered User
    Join Date
    08-06-2013
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    72

    Re: IF formula not accepting 1?

    Hi ragulduy,

    I tried it...but when E4 is empty it shows 6056% and when I input a 1 it drops to 30%. That doesn't seem right either.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: IF formula not accepting 1?

    Maybe this

    =IF(D4="",E4*1.05/(40*5.1),E4*1.05/(D4*40*5.1))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: IF formula not accepting 1?

    @OP,

    In that case, the original formula is correct:
    E4*1.05/(40*5.1)
    is the same as
    E4*1.05/(D4*40*5.1)
    When D4 is = 1, so if you enter 0 and 1 you will get the same answer, I thought by "remove that part of the equation" you meant that you would want E4*1.05 if D4 is 0. Maybe you need to clarify with an example value in E4 what the correct values with D4 = 0, 1, 2 etc should be.

  6. #6
    Registered User
    Join Date
    08-06-2013
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2003
    Posts
    72

    Re: IF formula not accepting 1?

    Good point....I'll try to clarify.

    The original formula was =E4*1.05/((D4*40*5.1))

    If there is nothing in D4, there is an error. However, when nothing is in D4, I'd like for it to do the following: =E4*1.05/((40*5.1)) the reason being that there should still be a percentage here if there are no employees in D4.

    However, when using =IF(D4="",E4*1.05/(40*5.1),E4*1.05/(D4*40*5.1))

    If there is nothing in D4 it's showing 30%, which seems right. But when I place a 1 in D4 it remains 30% (which isn't right - why would it remain teh same, it should be reverting back to (D4*40*5.1))? When I put a 2 it drops to 15%.

    So basically, it seems to give me the same result whether I input 0 or 1 in D4 - and only changes when I put in a 2, 3 etc. (anything higher than a 1).

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: IF formula not accepting 1?

    Hi,

    Not sure I understand. The TRUE part of your IF statement is:

    E4*1.05/(40*5.1)

    and the FALSE part:

    E4*1.05/(D4*40*5.1)

    but of course if D4=1 then this last reduces to:

    E4*1.05/(40*5.1)

    which is precisely the same as your TRUE part. So naturally if D4=1 then nothing will change.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: IF formula not accepting 1?

    Hi

    40*5.1 = 204
    D1*40*5.1 = 1*40*5.1 = 204
    So the formula is giving you the results you shoudl be expecting.

+ 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] Trend formula not accepting Offset ranges
    By DanRiverBrew in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-14-2013, 02:30 PM
  2. Cells not accepting format
    By FashionablyDoomed in forum Excel General
    Replies: 0
    Last Post: 08-15-2011, 12:25 PM
  3. Formula Not Accepting Values from Multiple Worksheets
    By nnewlin in forum Excel General
    Replies: 7
    Last Post: 07-12-2011, 01:00 PM
  4. vba not accepting the symbol <
    By smithy_o7 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-29-2010, 08:33 AM
  5. Cell Not Accepting Formula
    By boylejob in forum Excel General
    Replies: 2
    Last Post: 10-31-2007, 12:38 PM

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