+ Reply to Thread
Results 1 to 18 of 18

Countif problem (with formule inside)

Hybrid View

keis386 Countif problem (with formule... 07-20-2012, 06:12 AM
Fotis1991 Re: Countif problem (with... 07-20-2012, 06:18 AM
keis386 Re: Countif problem (with... 07-20-2012, 06:22 AM
dilipandey Re: Countif problem (with... 07-20-2012, 06:35 AM
martindwilson Re: Countif problem (with... 07-20-2012, 06:40 AM
Fotis1991 Re: Countif problem (with... 07-20-2012, 06:49 AM
keis386 Re: Countif problem (with... 07-20-2012, 07:36 AM
keis386 Re: Countif problem (with... 07-20-2012, 08:24 AM
martindwilson Re: Countif problem (with... 07-20-2012, 09:35 AM
NBVC Re: Countif problem (with... 07-20-2012, 09:37 AM
martindwilson Re: Countif problem (with... 07-20-2012, 10:13 AM
martindwilson Re: Countif problem (with... 07-20-2012, 10:08 AM
keis386 Re: Countif problem (with... 07-20-2012, 10:11 AM
NBVC Re: Countif problem (with... 07-20-2012, 10:10 AM
keis386 Re: Countif problem (with... 07-20-2012, 10:50 AM
NBVC Re: Countif problem (with... 07-20-2012, 10:56 AM
icestationzbra Re: Countif problem (with... 07-20-2012, 11:18 AM
keis386 Re: Countif problem (with... 07-22-2012, 04:04 AM
  1. #1
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Countif problem (with formule inside)

    I have a short question where I am struggling with for a while:

    I have a formule with countifs:
    I want to count if:

    Count if the seperate values in column G minus K45 are bigger than 30.

    I tried a lot of things like the option below: (I know bit stupid option)
    =COUNTIF(ALL!$G:$G;"-k45"&">=30")

    Hope someone can help me!

    Thanks a lot
    Last edited by keis386; 07-22-2012 at 04:05 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Countif problem (with formule inside)

    Hi

    You can use a helper and hidden column to do easy this.

    Let's say in H2 & copy down put this.

    =G2-$K$45

    Then use simple countif.

    =COUNTIF(H:H,">30")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Re: Countif problem (with formule inside)

    I thought about this option.
    But then I need a lot of helpcolumns because every day the column changes.

    So I rather do it without helpcolumns

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Countif problem (with formule inside)

    Hi Kies386,

    Please share a sample workbook. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Countif problem (with formule inside)

    try
    =SUMPRODUCT(--(G1:G5000-(ROW(G1:G5000)/ROW(G1:G5000)*K45)>30))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Countif problem (with formule inside)

    Excellent way of thinking, Martin!

  7. #7
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Re: Countif problem (with formule inside)

    Thanks a lot!

  8. #8
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Re: Countif problem (with formule inside)

    STill having some problems: please see attached file

    Need to fill in N3 to R3. But then without helpcolumns
    Attached Files Attached Files

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Countif problem (with formule inside)

    what are you counting,you cant count dates like that ,all dates since 31/01/1900 are >30
    Last edited by martindwilson; 07-20-2012 at 09:37 AM.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Countif problem (with formule inside)

    Please don't duplicate threads.. continue in one thread only!
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Countif problem (with formule inside)

    for the data you have its every cell in g - n2
    =SUMPRODUCT(--((ROW(G2:G74)/ROW(G2:G74)*N2)-G2:G74>=30))
    or seeing your other thread
    =SUMPRODUCT(--(N2-$G$2:$G$74>=30)) =26

    hmm
    =SUMPRODUCT(--(ABS($G$2:$G$74-N2)>30))=25
    =SUMPRODUCT(--(ABS($G$2:$G$74-N2)>=30)) =27
    and i learnt something too !
    Last edited by martindwilson; 07-20-2012 at 10:16 AM.

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Countif problem (with formule inside)

    for the data you have its every cell in g - n2
    =SUMPRODUCT(--((ROW(G2:G74)/ROW(G2:G74)*N2)-G2:G74>=30))

  13. #13
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Re: Countif problem (with formule inside)

    Hi thanks,

    This is exacly what I wanted.

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Countif problem (with formule inside)

    Since your other thread was closed, my offering, based on my understanding was:

    =SUMPRODUCT(--(ABS($G$2:$G$74-N2)>30))


    copied across...

  15. #15
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Re: Countif problem (with formule inside)

    Hi, every day I add new dates to column G. So then I have to change the formula each time (G74 to G75 etc).

    Is there a way I do not have to change this every time?

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Countif problem (with formule inside)

    Create a Dynamic Named Range.

    Go to Formula tab, Define Name and enter a name like: TradeDates

    Then enter formula:

    =Sheet1!$G$2:INDEX(Sheet1!$G:$G,COUNT(Sheet1!$G:$G)+1)

    Click Ok.

    Now replace the G range(s) in your formula with TradeDates.

  17. #17
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Countif problem (with formule inside)

    instead of Dynamic Ranges, see if you can work with the Table feature, which automatically expands upon addition of data. highlight the cell TRADE DATE (cell G1) in your sheet. then Insert > Table (keyboard shortcut ALT > N > T). make sure to confirm the entire range is showing, including the header cell. keep the checkbox checked on and click on OK. if it is the first table in the workbook, it should be named Table1, but you can confirm that by going to Formulas > Name Manager (ALT > M > N). use the table's name in your formula. whenever you add a new value to the table, the table will automatically expand and the formula is be updated.

    for e.g., NBVC's formula would become:

    =SUMPRODUCT(--(ABS(Table1-N2)>30))
    Last edited by icestationzbra; 07-20-2012 at 11:03 PM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  18. #18
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Re: Countif problem (with formule inside)

    Thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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