+ Reply to Thread
Results 1 to 7 of 7

Help with an If statement

  1. #1
    Registered User
    Join Date
    08-06-2014
    Location
    sewell. nj
    MS-Off Ver
    2007
    Posts
    3

    Help with an If statement

    I have an if statement =IF(B7>=35%,"Y",0) that is looking at cell B7 which is a formula =SUM('03Roof'!H29), but it isn't responding correctly to the result that B7 is coming back with. When it returns 35% or greater it still says 0, but if I manually enter a 35% in B7, then it returns the correctly result.

    How do I fix this?

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Help with an If statement

    Try changing it as follows and see if it works:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help with an If statement

    35% returned by a formula is 0.35, the cell formatting makes it look like 35%

    Your formula should be:-

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Help with an If statement

    Why are you using SUM(one_cell)? Just use ='03Roof'!H29

    What is the value in cell H29? (Not what is shown on screen, but the actual value of the cell.) If the value is 35, then there's your problem.

    In Excel, 35% is 0.35, while 35 would equate to 3500%. (Multiply decimal by 100.)

    Although, 35 is still greater than or equal to 0.35, so it should show "Y". Are H29 or B7 formatted as text?

  5. #5
    Registered User
    Join Date
    08-06-2014
    Location
    sewell. nj
    MS-Off Ver
    2007
    Posts
    3

    Re: Help with an If statement

    I changed it to =IF(B7>=0.35,"Y",0) and it still returned 0.

    Paul - I used =SUM before "03Roof'!H29 because I just click on formulas the the sum symbol and go to the tab where the number is that I need and click on it. It's just easier than typing in the name of the tab. When I click on H29 the formula that is in there is =F29/G29. It returned 35% in the cell and that's what I see, but there is a formula attached to it. Thanks.

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Help with an If statement

    Try posting the workbook (Reply - Go Advanced - Manage Attachments). Remove any sensitive data first (and any unnecessary sheets).

  7. #7
    Registered User
    Join Date
    08-06-2014
    Location
    sewell. nj
    MS-Off Ver
    2007
    Posts
    3

    Re: Help with an If statement

    I just figured out that it's not picking up the > or = part of my formula because when B7 is 36%, it works. It's not picking up the = to part of the formula.

+ 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. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  2. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  3. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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