+ Reply to Thread
Results 1 to 9 of 9

Division

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Southampton
    MS-Off Ver
    Excel 2003
    Posts
    49

    Division

    Hi there i need to divide multiple percentages by the total of cells with the data in.But I also need to display the data in one cell.
    for example;
    Total cell Formula
    A1=98% B1=95% = BB1 = 96.50% (=SUM(A1:B1)/2)
    A1=98% B1=95% C1=97% = BB1 = 96.67% (=SUM(A1:C1)/3)
    A1=98% B1=95% C1=97% D1=99% = BB1 = 97.25% (=SUM(A1:D1)/4) ...ETC

    But i need to do this 52 times.

    So what I want to know is, is there a way of BB1 constantly changing in accordance to how many figures are entered across the cells A-BA.
    So if I only have 14 cells with data in then;
    BB1 will be =SUM(A1:N1)/14
    OR
    31 cells with data in:
    BB1 will be =SUM(A1:AE1)/31

    Also the data is coming form another sheet in the document if that changes anything

    Kind Regards

    Deano3141

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Division

    Assuming your range of data that may be populated or not is A1: BA1

    =Sum(A1:BA1)/Count(A1:BA1)


    EDIT: This may be better if there are formula links

    =Sum(A1:BA1)/Countif(A1:BA1,"<>0")
    Last edited by alansidman; 03-04-2014 at 08:57 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-25-2014
    Location
    Southampton
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Division

    Thanks for the help. i have just tried it and it hase given me
    A1 B1 C1 D1 E1 F1 G1 H1 I1 J1 K1 L1 M1
    98.00% 98.00% 98.00% 98.00% 98.00% 98.00% 98.00% 98.00% 98.00% 98.00% 98.00% 98.00%
    TOTAL
    26.33%
    surely it should be 98

  4. #4
    Registered User
    Join Date
    02-25-2014
    Location
    Southampton
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Division

    Hi thanks. it works a treat.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Division

    ok. glad to have helped.

  6. #6
    Registered User
    Join Date
    02-25-2014
    Location
    Southampton
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Division

    Hello again the code =Sum(A1:BA1)/Count(A1:BA1) is working a treat however in the cell it is displaying #DIV/0!.
    I thought if I put an If statement at the beginning that it would return the figure to 0 however it comes up with #VALUE.

    =IF(A1:BA1= 0,0,SUM(A1:BA1)/COUNTIF(A1:BA1,"<>0"))

    PLEASE HELP

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Division

    How about just

    =if(count(a1:ba1), average(a1:ba1), "")


    or

    =iferror(average(a1:ba1), "")
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    02-25-2014
    Location
    Southampton
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: Division

    Thanks I've managed to do it myself.
    =IF(COUNTIF(B3:B3,"<>0")=0,0, (SUM(B3:BA3)/COUNTIF (B3:BA3,"<>0")))

    Sent from my GT-I9300 using Tapatalk

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Division

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. division gives wrong answer (division)
    By Brice in forum Excel General
    Replies: 5
    Last Post: 12-24-2010, 10:13 PM
  2. Division
    By samjs in forum Excel General
    Replies: 3
    Last Post: 02-22-2010, 02:01 AM
  3. Help with division
    By Twyko in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-11-2009, 04:48 PM
  4. Division by Zero
    By scotfitz in forum Excel General
    Replies: 5
    Last Post: 06-15-2008, 06:20 PM
  5. Division
    By milkshake in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2006, 12:12 AM

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