+ Reply to Thread
Results 1 to 8 of 8

Running formula

  1. #1
    Registered User
    Join Date
    09-26-2008
    Location
    Maidenhead
    Posts
    3

    Running formula

    Hello all

    Please can someone tell me what formula I can use to add a running total with variables? For example:

    If I have 4 cells with different numbers or letters in them I want it to be able to look at one cell and if it equals x then to add 1, then to look at the next cell and if this also equals x then add one and move to the next cell but if it doesn't then to stop?

    Does that make sense and is it even possible?

    Thanks

    James

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    if the numbers start in A1, in b2 put

    Please Login or Register  to view this content.

    Is that what you mean?

    Regards

    Dav

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    If depending on the cell's value you want to increase it's value with 1 VBA will be needed.

  4. #4
    Registered User
    Join Date
    09-26-2008
    Location
    Maidenhead
    Posts
    3
    Kind of...but for example.

    If It was to work out Bonus targets by month

    Cell 1 has a y
    Cell 2 has a y
    but cell 3 has N
    Cell 4 has a y

    The employee still would get the bonus for the first two months but not teh third but then the 4th, so it would be a total of 3 y's resulting in 3 points?

    Does that make it a bit clearer?

    The if formula nearly worked, but when there was an N it wouldn't award any points?

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    =countif(your_range,"y")

  6. #6
    Registered User
    Join Date
    09-26-2008
    Location
    Maidenhead
    Posts
    3
    Thanks again arthurbr

    However, is there a way of adding these different - so if a month has a harder target it's worth more points, so month 2 would be worth 4.
    Or a way of adding points to the Y's? so it doesn't just equal 4?

    Thanks!!

    James

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    It's possible but you will have to define what happens when, define targets, number of points depending on target, etc...
    Adding a sample of your data and what you want to do would be helpful

  8. #8
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    =-SUMPRODUCT(-(<y,n array>="y"),<values array>)

    for example
    =-SUMPRODUCT(-(D1:D7="y"),E1:E7)
    Where D1:D7 is y, y, n, y, n, etc. and E1:E7 is 2, 4, 1, 3, etc.

    HTH
    Last edited by Cheeky Charlie; 09-26-2008 at 12:43 PM. Reason: neaten up

+ 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. Running 12-months formula
    By b_motl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2008, 09:29 AM
  2. Running Mean Formula
    By pauldaddyadams in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-20-2008, 08:49 AM
  3. Dragging a formula, but keeping certain values
    By sprackers in forum Excel General
    Replies: 1
    Last Post: 05-13-2008, 10:59 AM
  4. Conditional formula question
    By odditie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-27-2007, 09:47 PM
  5. How do I subsitute part of a formula linked to another workbook?
    By Scej12 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-03-2007, 10:10 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