+ Reply to Thread
Results 1 to 7 of 7

Counting number of zeros between two values

  1. #1
    Registered User
    Join Date
    12-23-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    85

    Counting number of zeros between two values

    Hello,

    I have a file where I am looking to amortise rent payments across weeks between rent payments. To do that, I need to count the number of "0" cells between two rent payments, and divide the rent value by that amount. For example in the attached document, the formula would find the first $660, and divide that by three (c:e), then it would find the second 660, divide that by 3 as well (f:h), the third 660, divide that by 4 (i:l) etc..

    A few other points, some months rent are missed so the number of "0" between each rent payment won't be the same. Rent payments aren't always the same.

    Cheers,
    B
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,565

    Re: Counting number of zeros between two values

    Please manually fill in your expected outcomes and re-post the workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-23-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    85

    Re: Counting number of zeros between two values

    I have attached the desired outcome here:
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Counting number of zeros between two values

    Try in C4:

    =IF(AND(B3<>0,C3=0),INDEX(C3:$T$3,MATCH(TRUE,INDEX(C3:$T$3<>0,0),0))/MATCH(TRUE,INDEX(C3:$T$3<>0,0),0),B4)

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,940

    Re: Counting number of zeros between two values

    or
    c4=IF(OR(COLUMNS($C4:C4)=1,AND(B3>0,C3=0)),INDEX(C3:$T3,MATCH(1,INDEX((C3:$T3>0)+0,0),0))/MATCH(1,INDEX((C3:$T3>0)+0,0),0),IF(B3=0,B4,C3))
    Try this and copy towards right
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    07-14-2015
    Location
    melbourne, australia
    MS-Off Ver
    2013
    Posts
    7

    Re: Counting number of zeros between two values

    Hi all,

    I need a formula to help with calculating a drop down box...

    I want to use this to help quoting works, I have created a drop down box numbered 1-8 and need it so that when 1 is selected it is worth 500... Screen Shot 2017-08-21 at 22.00.00.png
    I will have this for multiple categories, then a box that calculates all for a final figure at the end...

    If this even possible?

    Any help greatly appreciated!!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,565

    Re: Counting number of zeros between two values

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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. Counting the Spans of Zeros between non-zero values
    By cewolfe in forum Excel General
    Replies: 5
    Last Post: 07-01-2016, 03:03 PM
  2. Replies: 2
    Last Post: 05-17-2016, 11:17 AM
  3. Replies: 10
    Last Post: 09-02-2015, 07:46 PM
  4. Counting number of values within a date range equal or great to a number
    By diablo_719 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-15-2013, 02:55 PM
  5. [SOLVED] Counting number of zeros between two non zero values in a string
    By simone77 in forum Excel General
    Replies: 13
    Last Post: 03-27-2012, 05:19 PM
  6. [SOLVED] Programming a macro - counting the number of zeros
    By calumll in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-27-2012, 05:19 AM
  7. [SOLVED] Counting number of consecutive zeros at the end of a list
    By lee.herring@gmail.com in forum Excel General
    Replies: 2
    Last Post: 09-22-2005, 08:05 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