+ Reply to Thread
Results 1 to 13 of 13

If Then Help

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    48

    If Then Help

    Please see the attached. My problem is there are times when the b column might actually equal zero, therefore my formula will only show the zero value and not the actual formula value.

    I used this formula so the cells in F28:F33 would have $0 show until a number was entered in the B column, then to let the formula drive the value. However I have times when the value in B will actually be 0, therefore not letting the formula run.

    How do I get my cells in F28:F32 to show zero when cells in the B column are blank and then let the formula run?

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: If Then Help

    Your question is quite confusing to understand. I don't know what you mean by "let the formula run". What exactly are you wanting to see that you are not seeing and where...what cells? Some examples of what you expect would be appreciated.

    Maybe you should be a little more explicit with the title of the thread giving what you are looking for instead of "help". Your last sentence has most of what could be the basis of a better title. This could attract more action to the question.
    Last edited by newdoverman; 06-15-2015 at 10:50 AM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: If Then Help

    In the example, F28 is showing "0". I want it to be $352 which is a result of taking the sum of E3:E7 and dividing it by B3:B7. I'm using the COUNTA function in B3:B7.

    Any of this can change if a better formula can be used.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: If Then Help

    Are you sure that is what you want. Do you want the average per day (1760/5=352) or something else???? Basically - why is 352 the answer?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: If Then Help

    Maybe this approach will work for you. The areas in yellow are what I did.

    I added a helper column to calculate the week.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then for the averages:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: If Then Help

    Maybe this will clear up any confusion...

    I took another stab at creating the example. I want my formula in column E (specifically E6) to automatically update the # of days as data is entered in column B.

    I also want future weeks to show $0 and not the zero error- hence why I used an if then. The problem I encountered is that when the cell being referenced does actually have a zero, the formula says to show a zero and not the sum of sales divided by the number of days.
    Attached Files Attached Files

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: If Then Help

    I don't understand at all why you are doing what you are doing. The first example calculates averages so why not use the AVERAGEIF function to sum and divide by the number of values to get the average?

    AVERAGEIF is using the week number and calculating the correct average for the week without having to count and sum.

    What you call the zero error are real zeros. The IFERROR enters a zero if the formula results in an error. Select the zeros produced for the future weeks and you will see that Excel (in the status bar at the bottom) counts the values and sums them. If this was just a visual presentation or text, that would not be the case.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: If Then Help

    I don't even think it's averageif. It's an average. you can use either of the two methods shown here. The one in green shading is fully automatic - it just needs a table of 5x5 days. the one in pink is closer to your original. If you don't like the green solution, dlete the additonal few rows and maually reset the last pink formula to suit.
    Attached Files Attached Files

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: If Then Help

    I don't understand why you are doing what you are doing. The first example was evidently calculating averages. Excel has functions for averaging (AVERAGE, AVERAGEIF etc).

    The week numbers that I showed how to calculate are used with the AVERAGEIF to calculate the average for the week without having to sum, count and divide.

    The zeros produced by the IFERROR for future weeks are real zeros and not a representations of zeros. To prove that, select them and in the status bar you will see that Excel has not only counted them but summed them as well...treating them as the numbers they are.

  10. #10
    Registered User
    Join Date
    07-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: If Then Help

    I think I was over thinking the formula- thanks guys

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: If Then Help

    It happens to me all too often!!

    Glad to have helped! If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: If Then Help

    Overthinking is as common as the common cold! Easy to get trapped into...we have all been there.

  13. #13
    Registered User
    Join Date
    03-12-2014
    Location
    Central Texas
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: If Then Help

    I believe what you're looking for is an alteration to your formula, so that when the space is BLANK, to show $0. but when it's actually zero, to run the formula, correct?
    If that's the case, then you're wanting the following:
    Please Login or Register  to view this content.
    That's saying if B3 is not blank (not the same as 0!), do this calculation; otherwise, result 0.
    Oh! I get it. I need rep--->҉

+ Reply to 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.6.0 RC 1