# Thread: Nest functions inside OFFSET function (Excel XP)

1. ## Nest functions inside OFFSET function (Excel XP)

Example: Column "A" contains numbers for the days in the current month (i.e 1, 2, 3 through 31). Column "B" contains the total sales numbers for each day. We want a cell that pulls the max from column "B" and returns the day of the month that corresponds to that highest number from column "A". Can the OFFSET function be used for this - and can I nest the MAX function inside of it (i.e. = OFFSET(MAX(B8:B38),0,-1). Seems like it should work, but it just WON'T. It tells me the syntax for the formula is incorrect. I've tried all types of configurations possible, with no luck). Is this not a proper use of the OFFSET function?

As an aside - I could get the proper result by inserting the days of the month in column "C", hiding that column and then creating a VLOOKUP formula that looks for the highest number in column "B" and returning the associated value in column 2("D"). Used FALSE to indicate that the first column was not in ascending order.

Any ideas, assistance or just informing me that it can't be done this way, would be greatly appreciated.

2. ## Re: Nest functions inside OFFSET function (Excel XP)

You don't have to lookat column A, the match gives you the number directly.:

=MATCH(MAX(B1:B31),B1:B31,FALSE)

Steve

3. ## Re: Nest functions inside OFFSET function (Excel XP)

Thank you, Steve. It worked like a charm. I was trying to make it too difficult!

4. ## Re: Nest functions inside OFFSET function (Excel XP)

I should mention the caveat:
You must have all the days of the month inclusive in ascending order. This does not actually LOOK at col A. It just finds what occurence down from the top in col B (1st, 2nd, 3rd, etc). Since you said that is how it is numbered, you can ignore looking at A.
Steve

5. ## Re: Nest functions inside OFFSET function (Excel XP)

After about 5 minutes of thinking it was magic, we figured that out when we deleted the info in column "A" and the function still worked. Thanks again.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•