Lost Excel Functions

Share

Facebook
Twitter
LinkedIn

Undocumented, Unloved and Unused Excel Functions

Following on from Chandoo’s MLookup function published on 1st April 2011, I thought it might be worth documenting a few undocumented, no-longer documented and rarely used Excel functions.

Although some of the functions below aren’t documented they still work as of Excel 2010.

Users should be cautious with their use going forward as Microsoft may withdraw them from future versions of Excel.

But if you see them appear in older Excel models at least you’ll be the full bottle.

This post will look at the following functions:

  • Datedif
  • Roundup
  • RoundDown
  • Evaluate
  • Convert
  • Roman
  • FactDouble
  • Bahttext

Worked examples of all these functions are presented in the Example File which is compatible with all versions of Excel.

Datedif

The DATEDIF function computes the difference between two dates in a variety of different intervals, such number of years, months, or days.

This function is available in all versions of Excel since at least version 5/95, but is documented in the help file only for Excel 2000.

By the way, do not confuse the DATEDIF worksheet function with the VBA DateDiff function.

Use:

=DATEDIF(Start Date, End Date, Interval)

Where:
Start Date must be less than the End Date.

Interval is the interval type to return.

Interval value must be one of the following:

Interval Meaning Description
m Months Complete calendar months between the dates.
d Days Number of days between the dates.
y Years Complete calendar years between the dates.
ym Months Excluding Years Complete calendar months between the dates as if they were of the same year.
yd Days Excluding Years Complete calendar days between the dates as if they were of the same year.
md Days Excluding Years And Months Complete calendar days between the dates as if they were of the same month and same year.

If you are including the Interval string directly within the formula, you must enclose it in double quotes:

=DATEDIF(Date1,Date2,”m”)

Examples:

Start Date 13/01/1963
End Date 12/05/2011
Years =DATEDIF($B$5,$C$5,”Y”) 48
Months =DATEDIF($B$5,$C$5,”M”) 579
Days =DATEDIF($B$5,$C$5,”D”) 17651
Months Exc. Years =DATEDIF($B$5,$C$5,”ym”) 3
Days Exc. Years =DATEDIF($B$5,$C$5,”yd”) 119
Days Exc. Years & Months =DATEDIF($B$5,$C$5,”mD”) 29
Start Date > End Date =DATEDIF($D$5,$D$4,”Y”) #NUM!

Use of the Datedif function on Chandoo.org:

Datedif has been used a number of times at Chandoo.org

http://chandoo.org/forums/topic/how-to-calculate-age-from-their-dob

http://chandoo.org/wp/2009/09/22/elapsed-time-excel/

http://chandoo.org/wp/2008/08/26/date-time-tips-ms-excel/

Disclaimer:

Although the Datedif function above isn’t documented it still works as of Excel 2010. Users should be cautious with their use going forward as Microsoft may withdraw support for them in future Excel versions.

ROUNDUP() and ROUNDDOWN()

The Roundup and Rounddown functions rounds a number up or down, away from zero and have pretty much been replaced by the Round function.

Use:

The Roundup function rounds a number up, away from zero.

=ROUNDUP(number, num_digits)

The Rounddown function rounds a number down, towards zero.

=ROUNDDOWN(number, num_digits)

Roundup() behaves similarly to the Round() function, except that it always rounds a number up based on the following rules:

  • If num_digits is greater than 0, then number is rounded up to the specified number of decimal places.
  • If num_digits is 0 or omitted, then number is rounded up to the nearest integer.
  • If num_digits is less than 0, then number is rounded up to the left of the decimal point.

Examples:

ROUNDUP(4.1,0) equals 5

ROUNDUP(106.9,0) equals 107

ROUNDUP(3.14159, 3) equals 3.142

ROUNDUP(-3.14159, 1) equals -3.2

ROUNDUP(31415.926, -2) equals 31500
Rounddown() behaves similarly to the Round() function, except that it always rounds a number down based on the following rules:

  • If num_digits is greater than 0, then number is rounded down to the specified number of decimal places.
  • If num_digits is 0 or omitted, then number is rounded down to the nearest integer.
  • If num_digits is less than 0, then number is rounded down to the left of the decimal point.

Examples:

ROUNDDOWN(4.1, 0) equals 4

ROUNDDOWN(106.9,0) equals 106

ROUNDDOWN(3.14159, 3) equals 3.141

ROUNDDOWN(-3.14159, 1) equals -3.1

ROUNDDOWN(31415.92654, -2) equals 31400

Use on the Roundup and Rounddown functions on Chandoo.org:

The Roundup and Rounddown functions have been used several times at Chandoo.org

Roundup

http://chandoo.org/wp/2010/04/29/quarterly-totals-from-monthly-data/

http://chandoo.org/wp/2010/04/30/quarterly-totals-multi-year-data/

Rounddown

http://chandoo.org/wp/2010/04/30/quarterly-totals-multi-year-data/

http://chandoo.org/wp/2009/07/06/excel-formulas-round-sort/

 

Evaluate

Evaluate is an Excel ver 4.0 macro function which is still supported and functional in Excel 2010.

The Evaluate function allows for the evaluation of a text equation as an algebraic equation.

The evaluate function cannot be used as a spreadsheet function but can be used in Named Ranges.

It is probably best described by example; Evaluate 1, from the Example File.

Example:

Say you have a polynomial equation in a cell as Text A1: ‘=X2 + 5*Y – Z

Setup 3 named ranges, X, Y , Z with values X=10, Y=5 and Z=3

You can use Evaluate in a a Named Range eg: Result =Evaluate(SheetName!$A$1)

And then on a worksheet =Result, which will return the answer 122 = 102 + 5*5 – 3

Evaluate can be used to allow graphing of equations without use of worksheet functions or even worksheet ranges, an example of each is shown in the examples file as Evaluate 2 and Evaluate 3 .

Evaluate 2: Uses a Range as the X Values and a Named Range using the Evaluate function as the calculated Y Values

Evaluate 3: Uses Named Ranges as the X Values and as the calculated Y Values based on an Evaluate function

 

 

 

 

 

 

 

 

 

Use of the Evaluate function on Chandoo.org:

Not Used


Convert

Converts a number from one measurement system to another.

For example, CONVERT can translate a table of distances in Kilometres to a table of distances in Miles.

Convert includes 49 units spread amongst the following 10 categories

Category No Units
Weights & Mass, 5
Time 5
Force 3
Power 2
Temperature 3
Distance 8
Pressure 3
Energy 9
Magnetism 2
Liquid Measures 9

Use:

=Convert(number, From Unit, To Unit)

A list of all the Conversion Units and Conversion Prefixes is included on the Conversion Factors tab of the Examples File.

Examples:

Example Result Description (Result)
=CONVERT(5, “lbm”, “kg”) 2.27 Converts a 5 pound mass to kilograms (2.267)
=CONVERT(80, “F”, “C”) 6.67 Converts 80 degrees Fahrenheit to Celsius (26.6)
=CONVERT(1, “ft”, “kg”) #N/A Data types are not the same so an error is returned (#N/A)
‘=CONVERT(CONVERT(100,”ft”,”m”),”ft”,”m”) 9.29 Converts 100 square feet into square meters (9.290304).

 

A list of all the Conversion Units and Conversion Prefixes is included on the Conversion Factors tab of the Examples File.

Use of the Convert function on Chandoo.org

http://chandoo.org/forums/topic/convert-function

 

Roman

The Roman function converts a number to Roman format.

Use:

=ROMAN(number, form)

=ROMAN(45 ) = XLV

Form is a number specifying the type of roman numeral you want. The roman numeral style ranges from Classic to Simplified, becoming more concise as the value of form increases.

Form Type
0 or omitted Classic.
1 More concise. See example below.
2 More concise. See example below.
3 More concise. See example below.
4 Simplified.
TRUE Classic.
FALSE Simplified.

Example:

Example Formula Description (Result)
=ROMAN(2011) MMXI Converts 2011 to Roman (MMXI)
=ROMAN(499,0) Classic or Omited CDXCIX Converts 499 to Roman (CDXCIX)
=ROMAN(499, True) Classic CDXCIX Converts 499 to Roman (CDXCIX)
=ROMAN(499,1) More Concise LDVLIV Converts 499 to Roman (LDVLIV)
=ROMAN(499,2) More Concise XDIX Converts 499 to Roman (XDIX)
=ROMAN(499,3) More Concise VDIV Converts 499 to Roman (VDIV)
=ROMAN(499,4) Simplified ID Converts 499 to Roman (ID)
=ROMAN(499, False) Simplified ID Converts 499 to Roman (ID)

Use of the Roman function on Chandoo.org:

Nil


Factdouble

Factdouble returns the double factorial of a number and is expressed in mathematics as n!!

Double factorials are used in probability theory and other higher levels of mathematics and is really just a way to simplify an otherwise complex expression

If the number is Even Factdouble = n(n-2)(n-4)…(4)(2)

If the number is Odd Factdouble = n(n-2)(n-4)…(3)(1)

So it is simpler to write 10!! than 10x8x6x4x2

Use:

=Factdouble( number )

Example:

Example Result Description (Result)
=Factdouble(8) 384 Factdouble of 8 = 8x6x4x2 = 384
=Factdouble(9) 945 Factdouble of 9 = 9x7x5x3x1 = 945

 

Use of the Factdouble function on Chandoo.org

Not used

 

Bahttext

Converts a number to Thai Text represention of the number

Use:

=Battext( Number)

Example:

=Bahttext(250) , Returns

Use of the Bahttext function on Chandoo.org:

Not used

 

Examples

An example file with worked examples from all the above functions is available from the following link; Example File

The file is compatible with all Excel versions.

 

What Functions Have You Discovered?

What Functions Have You Stumbled Onto?

Let us know in the comments below:

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

40 Responses to “Looking up when the data won’t co-operate (case study)”

  1. Sumit Bansal says:

    Nice Trick.. Clever use of cell references

    Here is a formula I tried to create:
    =SUMPRODUCT(((NOT(ISERROR(SEARCH(L5,B4:H14))))*1),(B5:H15))

    It takes care of Caveat #1 (can handle text), but Caveat #2 remains.

  2. PeterB says:

    In situations like this, I will often use VBA to restructure the data (2 columns: dates and values) on to a new worksheet. I can then use this 'clean' source for data analysis (formula or pivot table).

    =SUMPRODUCT(((NOT(ISERROR(SEARCH(L5,B4:H14))))*1),(B5:H15)) and complex formulae in general are all very well but when you come back to them in a few weeks / months time, it is not at all easy to see what they do and what the limitations are.

  3. Somendra Misra says:

    Hi Chandoo,

    I had used this type of cell ref. various times while calculating average.
    But for the situation here try below formula . Note this is an array formula and must be confirmed with Ctrl+Shift+Enter.

    =SMALL(IF(MMULT((L5=B4:H14)*IF(ISNUMBER(B5:H15),B5:H15),{1;1;1;1;1;1;1}),MMULT((L5=B4:H14)*IF(ISNUMBER(B5:H15),B5:H15),{1;1;1;1;1;1;1})),1)

    Regards,

  4. Somendra Misra says:

    Hi, I think Using SEARCH in here will create a problem say there is a text like SUN and another text SUNLIGHT both result will be added by SUMPRODUCT.

    Regards,

  5. Elias says:

    Array option.

    =SUM(IF(MOD(ROW(B4:B14),2)=MOD(ROW(B4),2),IF(B4:H14=L5,B5:H15)))

    Regards

    • Michael (Micky) Avidan says:

      @Elias,
      Nice approach.
      Although not requested - the formula I suggested closes all possibilities.
      Criteria: _____ Value to retrieve:
      Date__________ Numeric
      Date__________Textual
      Textual________Numeric
      Textual________Textual
      While your formula copes with only the 3 first combinations.
      Michael (Micky) Avidan
      “Microsoft® Answer” – Wiki author & Forums Moderator
      “Microsoft®” MVP – Excel (2009-2015)
      ISRAEL

      • Elias says:

        @Michael,

        Sorry but I don’t understand your point. I believe the challenge was to return the summary of a given date. What is your really volatile formula doing that mine is not?

        Regards

        • Michael (Micky) Avidan says:

          @Elias,
          I didn't say that the challenge differs from what you just mentioned/aimed to nor that your formula doesn't provide the requested result.
          Please read my previous comment again and focus on the last combination (TEXT / TEXT).
          I, myself, always try to provide a global Formula that is capable to handle all sorts of data.
          Michael (Micky) Avidan
          “Microsoft® Answer” – Wiki author & Forums Moderator
          “Microsoft®” MVP – Excel (2009-2015)
          ISRAEL

          • Elias says:

            @Michael,
            I see your point, but you are missing the below points if you are trying to cover all sorts of data.

            What happened if the lookup value does not exist?

            Do you want the first, second, summary, concatenation of the values if the look value is repeated?

            See they are too many possibilities to be cover with just one formula.

            Regards

  6. Michael (Micky) Avidan says:

    1) The range: B4:H15 was named: RNG.
    2) The following Array Formula was "retrieved from my sleeve" and I hope it can be shorten.
    3) The formula seems to take care of BOTH(!) caveats.
    -------------------------------------------------------------------------------
    =OFFSET(INDIRECT(ADDRESS(SMALL(IF(RNG=L5,ROW(RNG),""),1),MOD(SMALL(IF(RNG=L5,(ROW(RNG))+COLUMN(RNG)/10),1),1)*10)),1,)
    -------------------------------------------------------------------------------
    Michael (Micky) Avidan
    “Microsoft® Answer” – Wiki author & Forums Moderator
    “Microsoft®” MVP – Excel (2009-2015)
    ISRAEL

    • Elias says:

      @Michael,

      Check what happened with your result if you type 41927 in D5.

      Regards

      • Michael (Micky) Avidan says:

        Correct. Didn't predict that.
        Will find time to work something out.
        Michael (Micky) Avidan
        “Microsoft® Answer” – Wiki author & Forums Moderator
        “Microsoft®” MVP – Excel (2009-2015)
        ISRAEL

      • Michael (Micky) Avidan says:

        @Elias,
        Let's hope the following Array Formula "closes all open doors".
        Again - it has nothing to do with your formula which works fine as long as the 3 first mentioned combinations are concerned.
        -------------------------------------------------------------------------------
        =INDEX(RNG,LARGE(IF(RNG=L5,MOD(ROW(RNG)-1,2)*(ROW(RNG)),""),1)-2,(MOD(SMALL(IF(RNG=L5,(ROW(RNG))+COLUMN(RNG)/10),1),1)*10)-1)
        -------------------------------------------------------------------------------
        Michael (Micky) Avidan
        “Microsoft® Answer” – Wiki author & Forums Moderator
        “Microsoft®” MVP – Excel (2009-2015)
        ISRAEL

        • Elias says:

          Ok, if you insist. The following will cover all the scenarios you listed. However, I’ll never recommend/use such of formula.

          Defined names:
          rDat = $B$4:$H$15
          rRow =ROW(rDat)-MIN(ROW(rDat))+1
          rCol =COLUMN(rDat)-MIN(COLUMN(rDat))+1
          rInc =MOD(rRow,2)=MOD(MIN(rRow),2)

          L6=INDEX(rDat,MAX(IF(rInc,IF(rDat=L5,rRow)))+1,MAX(IF(rInc,IF(rDat=L5,rCol))))
          Array Enter

          Regards

        • Frank says:

          @Michael,

          unfortunately, your array formula still seems to return wrong results (eg 3-Nov).

  7. Magda says:

    If data are organized like in the example, ie. looks like a calendar, the INDEX formula seems quite simple:
    =INDEX($B$4:$H$15,ROUNDDOWN((L5-B4)/7,0)*2+2,MOD((L5-B4),7)+1)

    • Marc says:

      Yours is effectively the same as what I just came up with, and I believe this is the optimal answer to this particular problem.

      My solution, before I saw yours:
      =OFFSET(B5,QUOTIENT(L5-B4,7)*2,MOD(L5-B4,7))

      OFFSET will work for an arbitrary list size, but INDEX might be easier to read.
      QUOTIENT does the round and division in a single step.

  8. XOR LX says:

    If there's an improvement over Elias's solution then I for one can't see it.

    Perhaps a non-CSE version which would also mean that only two references (B4:H14 and B5:H15), as opposed to three (B4, B4:B14 and and B5:H15), would require manually amending should the data range change, i.e.:

    =SUMPRODUCT((ISEVEN(ROW(B4:H14)-MIN(ROW(B4:H14)))*(B4:H14=L5)*B5:H15))

    I suppose we could make it a single, uniform range reference:

    =SUMPRODUCT((ISEVEN(ROW(B4:H14)-MIN(ROW(B4:H14)))*(B4:H14=L5)*OFFSET(B4:H14,1,,,)))

    which might be more appropriate should we e.g. wish to use a Defined Name for our range, i.e.:

    =SUMPRODUCT((ISEVEN(ROW(Rng)-MIN(ROW(Rng)))*(Rng=L5)*OFFSET(Rng,1,,,)))

    though whether that compensates for the extra, volatile function call is something to be debated.

    Regards

  9. Mahir says:

    I have tried something and then my Excel workbooks got shut down. Maybe that was too much?

    Anyway here is what I've tried:

    =SUMPRODUCT(INDEX(B5:H15;IF(ISEVEN(ROW(B5:H15));ROW(B5:B15)-ROW(B5)+1);{1\2\3\4\5\6\7}))

    Guess that was wrong? Would this approach work anyway?

    Looking forward to learn something from you Excel Experts.

  10. XOR LX says:

    @Michael Avidan

    As it stands that is not a very rigorous construction.

    You say "I, myself, always try to provide a global Formula that is capable to handle all sorts of data", which is a wonderful philosophy, but isn't it at least as important that we ensure that our formulas are independent of the row and column references of the data range in question, so that, should that range change, we do not have to re-work our solution?

    What happens with your formula, for example, if RNG is instead re-located one row down, from B4:H15 to B5:H16?

    When a formula is reliant upon the addition/subtraction of certain constants within the formula, which themselves are necessarily dependent upon the specific rows/columns in which the data lies at any given time (e.g. the -1 in MOD(ROW(RNG)-1,2)), then that formula is not a very flexible one.

    Hence the reason for my choice of a slightly longer construction:

    ROW(B4:H14)-MIN(ROW(B4:H14))

    which ensures that this part of the calculation is not dependent upon the precise location of the data range within the worksheet, and so will give correct answers even if that range is re-located.

    Regards

  11. Haz says:

    {=OFFSET(B4,MAX((B4:H15=L5)*ISODD(ROW(1:12))*ROW(1:12)),MAX((B4:H15=L5)*ISODD(ROW(1:12))*COLUMN(A:G))-1)}

    • Haz says:

      Non-array formula:
      =INDEX(B4:H15,SUMPRODUCT((B4:H15=L5)*(ROW(B4:H15)-ROW(B4)+1)*ISODD(ROW(B4:H15)-ROW(B4)+1))+1,SUMPRODUCT((B4:H15=L5)*(COLUMN(B4:H15)-COLUMN(B4)+1)*ISODD(ROW(B4:H15)-ROW(B4)+1)))

      Using one range (B4:H15), one reference (B4), one lookup value (L5) and no INDIRECT or OFFSET.

  12. MF says:

    My trial with defined names:

    DateRange
    =$B$4:$H$4,$B$6:$H$6,$B$8:$H$8,$B$10:$H$10,$B$12:$H$12,$B$14:$H$14

    Position
    =RANK('lookup problem'!$L$5,DateRange,1)

    L6
    =OFFSET(B4,ROUNDUP(Position/7,0)*2- 1,IF(MOD(Position,7)=0,6,MOD(Position,7)-1))

  13. Jeff Weir says:

    I'd probably just run with something like:
    =SUMPRODUCT((B4:H14=L5)*(MOD(ROW(B4:H14),2)=MOD(ROW(B4),2))*B5:H15)
    ...which is basically the same as Elias' but without the IFs

  14. Bermir says:

    The opposite of elegant but it works...

    =INDEX(B4:H15,IFERROR(MATCH(L5,B4:B14,0),0)+IFERROR(MATCH(L5,C4:C14,0),0)+IFERROR(MATCH(L5,D4:D14,0),0)+IFERROR(MATCH(L5,E4:E14,0),0)+IFERROR(MATCH(L5,F4:F14,0),0)+IFERROR(MATCH(L5,G4:G14,0),0)+IFERROR(MATCH(L5,H4:H14,0),0)+1,IFERROR(MATCH(L5,B4:H4,0),0)+IFERROR(MATCH(L5,B6:H6,0),0)+IFERROR(MATCH(L5,B8:H8,0),0)+IFERROR(MATCH(L5,B10:H10,0),0)+IFERROR(MATCH(L5,B12:H12,0),0)+IFERROR(MATCH(L5,B14:H14,0),0))

    • Bermir says:

      =INDEX(B4:H15,
      IFERROR(MATCH(L5,B4:B14,0),0)+
      IFERROR(MATCH(L5,C4:C14,0),0)+
      IFERROR(MATCH(L5,D4:D14,0),0)+
      IFERROR(MATCH(L5,E4:E14,0),0)+
      IFERROR(MATCH(L5,F4:F14,0),0)+
      IFERROR(MATCH(L5,G4:G14,0),0)+
      IFERROR(MATCH(L5,H4:H14,0),0)+1,
      IFERROR(MATCH(L5,B4:H4,0),0)+
      IFERROR(MATCH(L5,B6:H6,0),0)+
      IFERROR(MATCH(L5,B8:H8,0),0)+
      IFERROR(MATCH(L5,B10:H10,0),0)+
      IFERROR(MATCH(L5,B12:H12,0),0)+
      IFERROR(MATCH(L5,B14:H14,0),0))

  15. HF says:

    Named Range
    rownum = SUMPRODUCT(('lookup problem'!$B$4:$H$14='lookup problem'!$L$5)*ROW('lookup problem'!$B$4:$H$14)*ISEVEN(ROW('lookup problem'!$B$4:$H$14)))

    Formula
    =OFFSET($A$1,rownum,MATCH(L5,INDIRECT("$B"&rownum&":$H"&rownum),0))

  16. Venky says:

    How about SUM(IF(B4:H14=L5,B5:H15)) with array..it should work

  17. xen says:

    Sorry, Chandoo, you can't find stuff this way in every possible scenario.
    What if 2014-10-01 sales would equal 41.927 ? Which is serial number for 2014-10-15 ? SUMIF would fail to retrive correct answer. And your example data suggest that such number is possible in your table.

    It's better not to search through dates and numbers at the same time.

    If I'd solve a problem like this, it'd reformat table first so I get one column with dates and the other with numbers.

    In this case, formula to form date column would be:
    =INDIRECT(ADDRESS((INT((ROW()-4)/COUNT($B$4:$H$4))+1)*2+2;MOD(ROW()-4;COUNT($B$4:$H$4))+2;4;1))
    and numbers would be the same formula with sight adjustment (+3 instead of +2 at the end of first argument):
    =INDIRECT(ADDRESS((INT((ROW()-4)/COUNT($B$4:$H$4))+1)*2+3;MOD(ROW()-4;COUNT($B$4:$H$4))+2;4;1))

    And now you got two columns that you can safely use for searching!

  18. xen says:

    Oops, sorry, you actually mentioned that it doesn't work if number=date! I missed that part 🙁

  19. Vad says:

    ={OFFSET(A1,SUM((B4:H14=L5)*ROW((B4:H14))),SUM((B4:H14=L5)*COLUMN((B4:H14)))-1)}

    Works for all data... the solution I got for indirect looks little lengthy

  20. Rajesh says:

    I want to count last 20 records of a person, whose marks is greater than 2 and grade "manager". ....

    Assume A1 has got names (James, John...etc...)
    A2 "Manager"

    A3 "2"

    Someone please reply

  21. Rajesh says:

    I want to count last 20 records of a person, whose marks is greater than "2" and grade "Manager"

    Assume A1 "geroge" A2 "Michael" A3 "George" etc...name can found anywhere in the rows

    B1 "Manager" B2" clerk"

    C1 "2" C2, "4"

    please reply

  22. Marc says:

    Simplest I can come up with. No limitations for either 1 or 2. This does assume dates are an ordered list with 7 per row, and 2 rows per set. Assuming this is always true this will work for an arbitrary long list of dates.

    =OFFSET(B5,QUOTIENT($L$5-$B$4,7)*2,MOD($L$5-$B$4,7))

    • Michael (Micky) Avidan says:

      @Marc,
      Nice approach - however, as there are no "Negative Dates" - try:
      =OFFSET(B5,INT(L5-B4)/7)*2,MOD(L5-B4,7))
      ——————————————————————————-
      Michael (Micky) Avidan
      “Microsoft® Answer” – Wiki author & Forums Moderator
      “Microsoft®” MVP – Excel (2009-2015)
      ISRAEL

  23. Vijaykumar Shetye says:

    =OFFSET(B4,ROUNDUP((L5-41911+1)/7,0)*2-1,MOD(L5-41911,7))

    B4 has been used as reference cell for OFFSET().

    FOR ROWS:
    ROUNDUP(....,0) gives the integer value of a division. In case of presence of a remainder, ROUNDUP will add 1 to the Quotient.
    As opposed to ROUNDUP(), the INT() or QUOTIENT() functions eliminate the remainder.

    41911 = 01-Sept-2014, the first date in the data.

    *2 has been used because there are 2 columns per set of data.

    /7 has been used because there are 7 columns per set of data.

    For columns
    MOD(L5-41911,7))

    Vijaykumar Shetye,
    Panaji, Goa, India

  24. Awais says:

    This is how i did it

    {=INDEX(B4:H15, MAX((L5=B4:H15)*ROW(B4:H15))-2, MAX((L5=B4:H15)*COLUMN(B4:H15))-1 )}

  25. Paul says:

    Here's my solution:

    =INDEX(B4:H15,MATCH(1,MMULT(--(B4:H15=L5),TRANSPOSE(COLUMN(B4:H15)^0)),0)+1,MATCH(1,MMULT(TRANSPOSE(--(B4:H15=L5)),ROW(B4:H15)^0),0))

Leave a Reply