• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search results

  1. Colin Legg

    Negative value to make

    Did you try it like this? =TEXT(J4+D56-K4-D57,"0.00 ")&IF((J4+D56-K4-D57)>0,"debit","credit")
  2. Colin Legg

    Countif AutoFilter [SOLVED]

    Hi, With the autofilter on, to count the "Y"s: =SUMPRODUCT(SUBTOTAL(3,OFFSET(A4,ROW(A4:A100)-ROW(A4),,1))*(A4:A100="Y")) and to count the "N"s: =SUMPRODUCT(SUBTOTAL(3,OFFSET(A4,ROW(A4:A100)-ROW(A4),,1))*(A4:A100="N")) ------ Incidentally, you can do this more easily...
  3. Colin Legg

    List View Control in VBA [SOLVED]

    Okay, it sounds like a file the msstkprp dll depends upon is missing. I'll have to google for that. In the meantime, what operating system do you have and is it 32 or 64 bit?
  4. Colin Legg

    List View Control in VBA [SOLVED]

    Hi Vijay, The relevant information on the link was quoted in my last post. If you are not a local administrator then you'll need to ask your IT department to register the dll for you. (Even if you are, perhaps you should ask them to do it because company policy might not allow you to...
  5. Colin Legg

    List View Control in VBA [SOLVED]

    According to this link on Mark Dagosta's site you need to register a dll called Msstkprp. Make sure you're running as a local administrator when you register it: http://markdagosta.com/tag/listview/
  6. Colin Legg

    MAXIF

    Hi beroth, Array formulas can be slow to calculate if: -they reference large ranges -you use a lot of them in your worksheet -they contain expensive functions So generally: -Avoid using whole column references such as A:A or B:B (whole columns aren't allowed in array formulas prior to...
  7. Colin Legg

    matchmax formula

    Max: =INDEX(A1:A4,MATCH(MAX(B1:B4),B1:B4,0)) 2nd largest: =INDEX(A1:A4,MATCH(LARGE(B1:B4,2),B1:B4,0))
  8. Colin Legg

    MAXIF

    Unfortunately there isn't a MAXIF() function in the current versions of Excel. You can use an array formula which combines the MAX() and IF() functions to get the same result, or you can use a helper column. Suppose you have some data where you have a list of words in column A and you have a...
  9. Colin Legg

    CountIf or SumProduct... I don't know...

    Hi SirJB, I agree that SUMPRODUCT() is not volatile. I also agree that I prefer to use *IFS() whenever possible instead of SUMPRODUCT() because of calculation overhead and simplicity. The irony is that it is actually possible to make the *IFS functions volatile if you misuse them (!!)...
  10. Colin Legg

    Countifs on another Column

    Hi Gina, So the COUNTIFS() formula would be like: =COUNTIFS(A2:A10,"Criteria1",B2:B10,"Criteria2",C2:C10,"Criteria3") Say you put that formula in cell L2. Then your AVERAGEIFS() formula would be...
  11. Colin Legg

    CountIf or SumProduct... I don't know...

    Hi Deb, I'm not quite following the suggestion of using an array constant.... =COUNTIFS($C2:$C7,0,$B$2:$B$7,{">=4","<=12"}) returns a 2 element array so you need a SUM() wrapper: =SUM(COUNTIFS(C2:C7,0,B2:B7,{">=4","<=12"})) But, when you...
  12. Colin Legg

    Help with Count Formula

    Provided you are using Excel 2007 or later, I think you can do this with COUNTIFS() which is simpler than SUMPRODUCT(). =COUNTIFS(Telephony!H10:H145,"Analogue Phones",Telephony!C10:C145,"<>",Telephony!C10:C145,"<>Broken") So that formula says count...
  13. Colin Legg

    VBA to delete entire colum in the range if any colum is having #N/A

    If you can assume that you want to delete all error values (ie. #DIV/0! etc, not just #N/A) then you can use the Range.SpecialCells() method to get a reference to the cells containing formula errors and then delete them. Sub foo() Dim rngToCheck As Range, rngToDelete As Range...
  14. Colin Legg

    Sum of top 3 records based on filtered criteria

    You don't need the -- to coerce the boolean arrays because you're also multiplying them. So these formulae all do the same thing: {=SUM(LARGE((G7:G21="ME")*(H7:H21="High")*(I7:I21),{1,2,3}))} =SUMPRODUCT(LARGE((G7:G21="ME")*(H7:H21="High")*(I7:I21),{1,2,3}))...
  15. Colin Legg

    Congratulations NARAYANK991 4,000 Posts

    Many congratulations! :)
  16. Colin Legg

    Congratulations Hui 5,000 Posts

    Congratulations on this outstanding achievement. Looking forward to your next 5K!
  17. Colin Legg

    Sumif problem

    The option I would choose: In a spare column, eg cell E2, put the formula =C2*D2 and then fill down the column. Then you can use =SUMIF(B:B,"Age 8",E:E) Alternatively you can use SUMPRODUCT: =SUMPRODUCT(--(B2:B100="Age 8"),C2:C100,D2:D100) But the SUMPRODUCT formula is...
  18. Colin Legg

    Saving a file using vba

    You can concatenate the cell's value into the string: ActiveWorkbook.SaveAs _ Filename:="C:FolderSubfolder" & ActiveWorkbook.Worksheets("Sheet1").Range("A1").Value & "file.xlsx", _ FileFormat:=xlOpenXMLWorkbook, _ CreateBackup:=False Note the FileFormat and the...
  19. Colin Legg

    VBA with Arrays. Completely lost.

    Hi, Make sure the second array is the same size as the first array. Then loop through the first array and use the CInt() function to convert each element into an Integer and assign it to the second array. Since your second array should be of type Integer, you need to make sure that the values...
  20. Colin Legg

    Congratulations SirJB7 4,000 Posts

    Congratulations and well done. Now your target is to win the race to 5K!
  21. Colin Legg

    How to pick the values from a cell range into WHERE Clause?

    Since the values come from a single column, you can transpose them to a 1-D array and then use the VBA.Strings.Join() method to create a string from them. Here's a crude outline: Sub foo() Dim sSql As String sSql = "SELECT * from ABCD.EFGH_IJK where LMN IN " &...
  22. Colin Legg

    compile error user-defined type not defined

    Good idea. IMO Excel 2010 is a much better version than Excel 2007. :)
  23. Colin Legg

    VBA Code to remove passwords

    Try changing your SaveAs line to this: ActiveWorkbook.SaveAs _ Filename:="F:FinanceAccountsAccounts2013SNAPSHOTS" & "SNAPSHOT " & DATETEXT & ".xlsm", _ FileFormat:=xlOpenXMLWorkbookMacroEnabled, _ Password:="", _ WriteResPassword:="", _...
  24. Colin Legg

    VBA code to open a directory which contains a special symbol

    Hi Carley, There are spaces in the folder name so: x = Shell("explorer /n,/e,""group.netglobalCroydonBroker2013= Broker Complaints""", 1)
  25. Colin Legg

    compile error user-defined type not defined

    The SmartArtNode class was introduced in Office 2010. If you're using a version of Excel earlier than that then you won't be able to use it.
Back
Top