+ Reply to Thread
Results 1 to 3 of 3

Need Help Changing Divisor based on if a cell has a value

  1. #1
    Registered User
    Join Date
    01-28-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    4

    Need Help Changing Divisor based on if a cell has a value

    I am trying to create a formula that tracks overtime percentage essentially. My goal is that if the cell for week one has a value I want to divide that number by 40, if there is a value in week 1 and week 2 I want to divide the sum of the values by 80, if there is a value in week 1, week 2, and week 3 then I want to divide the sum by 120, and so one for week 4 and week 5. I was thinking and =IF function but I'm not sure if it is doable with that. Any thoughts?

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Need Help Changing Divisor based on if a cell has a value

    Try

    =IF(COUNTA(A1:E1)<>0,SUM(A1:E1)/COUNTA(A1:E1)*40,0)

    Explanation:
    Add up the weeks A1:E1
    Divide by the number of weeks that have been entered multiplied by 40
    1 week 40
    2 weeks 80
    3 weeks 120
    4 weeks 160
    5 weeks 200

    If 0 weeks filled then output 0
    Last edited by Special-K; 01-28-2015 at 10:45 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    01-28-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    4

    Red face Re: Need Help Changing Divisor based on if a cell has a value

    Thanks so much for the help, I will try that tomorrow morning, I think I ended up getting it to work through a very convoluted IF statement, but yours looks much simpler. I appreciate the help!

+ 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. Replies: 6
    Last Post: 10-04-2014, 12:39 PM
  2. [SOLVED] Changing fill color of shapes based on changing cell value
    By Stefan1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2012, 10:33 AM
  3. changing cell color based on changing values
    By tvonbehren in forum Excel General
    Replies: 2
    Last Post: 09-16-2009, 12:33 PM
  4. Change MOD divisor on-the-fly
    By Martindelica in forum Excel General
    Replies: 10
    Last Post: 04-08-2007, 03:12 PM
  5. Mod(number;divisor)
    By Mhek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2006, 09:45 AM

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