+ Reply to Thread
Results 1 to 9 of 9

What's wrong with my three formulas here?

  1. #1
    Registered User
    Join Date
    08-14-2017
    Location
    Liverpool, England
    MS-Off Ver
    2016
    Posts
    21

    Unhappy What's wrong with my three formulas here?

    Hi,

    I'm basically an Excel noob but I thought I had this particular sheet worked out. I just looked at it again and it obviously isn't providing the right numbers. I've attached an anonymised sheet with the problem columns NOT coloured in... So 3 questions for any Excel heroes out there:

    1) Why isn't the formula in column C giving me the first number from the string in column B?

    2) Why isn't the formula in column F giving me the total number of reports for that particular area by counting only the numbers in row D that correspond to the correct string in column A?

    3) How do I change the average formula in column G to do the average sum I need it to do (shown in the working column in italics?

    Any help much appreciated - I thought I had it sussed but very obviously not..
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What's wrong with my three formulas here?

    1st question: I don't know why, and I'm not going to try to figure it out.
    A much simpler method to return the first number in a string exists

    In C2, try
    =MID(B2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},B2&"0123456789")),1)

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: What's wrong with my three formulas here?

    2) F2 =SUMIF($A$1:$A$11,$E2,$D$1:$D$11) and drag down. I made a pivot table to show the same result.

    You selected the whole column in your formula, and that is why is also takes the values in A12 and further in your formula).

    3) See if the average in the pivot table match your expectations.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What's wrong with my three formulas here?

    2nd question

    Because the formula in F2 is referring to the ENTIRE COLUMN references of A and D
    So F2 is counting/summing the cells you added in your 'Should Look Like' Section.
    If you restrict F2 to only look at rows 2:11, then you'll get the correct results.
    =SUMIF($A$2:$A$11,E2,$D$2:$D$11)

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What's wrong with my three formulas here?

    Question 3)
    The MID function in Column C returns a TEXT string, even if it looks like a number.
    The AVERAGEIF function will see it as TEXT and will be considered 0.

    Change C2 to
    =IFERROR(MID(B2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},B2&"0123456789")),1)+0,0)

    AND observe the same problem of Question 2, not referring to the entire sheet including the 'should look like' section.

  6. #6
    Registered User
    Join Date
    08-14-2017
    Location
    Liverpool, England
    MS-Off Ver
    2016
    Posts
    21

    Re: What's wrong with my three formulas here?

    Thanks one and all. Much appreciated.

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: What's wrong with my three formulas here?

    You're welcome. We appreciate the feedback!

    Thanks for marking the question 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.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: What's wrong with my three formulas here?

    You're welcome.

  9. #9
    Registered User
    Join Date
    08-14-2017
    Location
    Liverpool, England
    MS-Off Ver
    2016
    Posts
    21

    Re: What's wrong with my three formulas here?

    I've added reputation for your both - only picked your post up this morning when I came back to check the thread.

+ 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. What's wrong with this Excel file? Formulas not working.
    By AlphaBob in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-26-2016, 01:03 PM
  2. What's wrong with my named formulas?
    By alchavar in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-25-2013, 08:13 PM
  3. Replies: 4
    Last Post: 01-18-2012, 09:55 PM
  4. What's Wrong With These Formulas????
    By scotfitz in forum Excel General
    Replies: 1
    Last Post: 07-27-2008, 08:33 PM
  5. Copy rows gives wrong formulas
    By treva26 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-14-2008, 07:29 PM
  6. formulas calling to wrong cells after query
    By minkus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-07-2007, 08:11 PM
  7. labels in formulas picking up wrong range
    By Carmen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-19-2005, 02:24 PM

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