Posts by daddylonglegs

Important Notice

Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.


    Quote from NBVC;670204


    I don't believe that formula will work (certainly not in Excel 2007) because WEEKNUM function can't handle ranges - in Excel 2007 and later, though, it can handle arrays so you can use +0 to convert like this:


    Re: How Reduce Formula

    I assume this is a Brazilian version of Excel, or Portuguese so SE = IF and PROC = LOOKUP

    That doesn't really explain the formula, though, because it's a series of IF functions like


    That uses LOOKUP with a lookup range of a single cell (!) so can be reduced to this


    and you can do the same throughout the formula.

    You could reduce considerably if there was some pattern to the arrangements....but there appear to be slight variations, e.g. the above tests A20 against A177 and if equal returns the value from 55 cells further down the column......but later in the formula this changes to 56...and the cells being tested are also variable distances apart. If you make the pattern consistent then you could use a simple one line formula........

    Re: countif criteria issue

    Don't know about the macro part but in COUNTIF you could simply add those two values as the criteria, e.g. if your data range is column A - your date (for the criteria) is in B2 and time in C2 you can use


    Re: Last Working Day of Month

    Quote from dtully;589640


    Is that supposed to give last workday in the month? Surely it doesn't, what if D1 is today?

    This thread is more than 6 years old so I'm not sure whether Cameron is still interested but this is simplest if you use WORKDAY to go back 1 working day from the 1st of the next month, i.e.


    Re: Vlookup / networkdays required

    I don't get #N/A when I use Kris' formula on your sample...but there are some strange results because you have rows where the date column is blank - what should happen then - what result do you expect. Also what about the situations when there are 2 or more matches, which date would you want. Is it the latest date?

    Re: VLookup Is Not Corresponding To Table


    I don't think sorting is the answer. One problem with that approach is that you can get "false matches" for codes that don't exist, e.g. what result do you get if you put "ZZ" in B20?

    For this sort of situation I assume that only an exact match makes the 4th argument of VLOOKUP needs to be included, i.e.


    With this version the table order is unimportant, it can be unsorted. Now if B20 is "ZZ" the formula returns #N/A

    Re: Future date by adding number of days including all days except the days I specify

    From your profile I see you have excel 2007. For that version you could try this array formula in C1


    confirmed with CTRL+SHIFT+ENTER

    In Excel 2010 there is an easier formula solution available by using the new WORKDAY.INTL function, i.e.


    Re: SMALL FUNCTION excluding blank cells

    Try this "array formula" in AL92

    =SMALL(IF(TEXT(Table1[Date],"dddd")=Z92,IF(Table1[Date]<>"",IF(Table1[[Early AM]:[Bed Time]]>0,Table1[[Early AM]:[Bed Time]]))),1)

    confirm with CTRL+SHIFT+ENTER and copy down to AL98 to get the minimum non-zero (and non-blank) value for each day. Note you need to correct the spelling of "WEDNESDAY" in Z95.........

    Re: Sumproduct severely slowing down spreadsheet

    How many rows are you referencing with the SUMPRODUCT formulas in your real data?

    It may be that OFFSET is contributing to the inefficiencies - OFFSET is a "volatile" function which means that it recalculates every time something is changed even if data directly affecting that formula doesn't change - INDEX is better, e.g. in C19 copied down


    and similar for your other formulas

    Re: IF function returning 0(blank) instead of TRUE.

    Sounds like you are misunderstanding how VLOOKUP works - if you use a formula like this


    Then if "x" is found in A2 the formula returns the value of B2 - if B2 is a blank you don't get #N/A, that only occurs if "x" isn't found anywhere in the lookup range (A2:A10). If you want to return some message if B2 is blank then you can do that like this


    You can replace "blank" with any text you want, even "" (a blank)

    If you also want "not found" then you could add an IFERROR function to that, i.e.

    =IFERROR(IF(Vlookup_formula="","blank",Vlookup_formula),"not found")

    Re: Formula to count unique with 3 criteria.

    Just a small suggestion.....

    rather than "hardcoding" the character length [10] in this part


    use LEN function, i.e.


    Now you can change cell O27 to anything you want without having to change the formula........

    Re: Calculate Average of First Lowest Scores over a Timespan

    The answer here depends on your setup. Are the scores in a row or a column, are the first scores at the top of the bottom (or left or right). If the player isn't there what goes in the cell for that week, is it left blank or filled with zero, text or something else?

    Assuming you have scores in B2:K2 with week 1 score in B2 and blanks where the player isn't there try this


    That's an "array formula" that needs to be confirmed with CTRL+SHIFT+ENTER

    You'll get an error if there are less than 4 numbers - what should happen then, e.g. if there are only 2 or 3 scores?

    Re: Search for value and return text in column header

    Assuming your table is in A1:D5 then with a specific zip code in F2 try this "array formula" to get the relevant header


    Formula needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar

    Re: SUMIFS formula w/ variable Sum_Range

    You can simply match B15 against the headers in E3 and F3 (on Data sheet). No need for any other table listing the ranges. Try this formula


    It's usually preferable to avoid volatile functions like INDIRECT where possible.......

    regards, daddylonglegs