+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    12-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Not ANOTHER 'nested IF' problem!!!

    Hello, everyone.

    I'm a long-time Excel user, but every now and then I find I need to do something just beyond my (admittedly basic) grasp of the functions I commonly use.

    I've put together a spreadsheet to keep track of my personal expenses. It includes a 'Totals' sheet which summarises the twelve monthly sheets, into which I want to incorporate a row displaying monthly averages.

    Say, for example, column C of the totals sheet contains car-related expenditure; cell C2 would pick up the monthly total from the January sheet, C3 that from February, C4 from March, and so forth. Cell C14 sums the values for the year, while C15 should calculate the average expenditure per month.

    Herein lies the problem (given the limitation of seven arguments in a nested IF statement). I'm trying to apply a formula to C15 which works out what the average is on the basis of how many of cells C2 through C13 contain a non-null value, then uses that as the divisor into the running total held in C14 to give the average, e.g. until C6 contains any data, the average should be based upon four months' worth of figures. (I'm aware of the limitations of this method, in that it will only be truly accurate on the last day of any given month and "read low" most of the rest of the time. Any suggestions on how to fix that?)

    All the examples I've seen in my research for a solution to the 'seven arguments' problem seem to be based upon using VLOOKUP to test the value in a single field against a range of values, rather than finding a way of saying "if C4 is null then divide by 2, else if C5 is null then divide by 3, else if..." etc.

    Any help would be greatly appreciated.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,158

    Re: Not ANOTHER 'nested IF' problem!!!

    Welcome to the forum,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    12-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Unhappy Re: Not ANOTHER 'nested IF' problem!!!

    Oh dear. I don't seem to have got off to a great start. My intention was to keep it light, given my expectation that the kind of problem I was posting about is fairly common and would be easily solved by an experienced Excel user.

    I also felt I had given a reasonably informative description of the problem, insofar as the limitations of the nested IF statement were at the root of it. (I, too, abhor such vague post titles as "Need advice" or "Help!"). Would it have been acceptable if I'd titled the thread simply "Nested IF problem"?

    Anyway, a friend who uses Excel happened to call by last night, and he made me aware of the COUNTA function, which seems to have solved the problem.

  4. #4
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,158

    Re: Not ANOTHER 'nested IF' problem!!!

    "Average calculation based on a range containing null cells"

    or similar would be more appropriate, I think
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,136

    Re: Not ANOTHER 'nested IF' problem!!!

    ... given my expectation that the kind of problem I was posting about is fairly common and would be easily solved by an experienced Excel user.
    And indeed it would. The problem is, it would benefit only you, because no one else with a similar problem would find the result by searching the forum. So those 'experienced Excel users' would have the opportunity to answer the same question with a thousand different and clever titles, again, and again, and again ...

    It's not that we don't appreciate the touch; join the Water Cooler forum and be as clever as you wish

    Now you know, and we're happy to have you here.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

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