Excel formula to obtain Cell Address which meets a certain criterion - excel-formula

In a row containing numbers, I need to get the address of that cell that contains the maximum value of the row.
I wish to find a local minimum. In my case it is the minimum value following after the global maximum. So I tried to get the line number of the cell with the global maximum, so I can start searching from there for MIN till to the last value in the row for the MIN. I with ADDRESS combined with MAX - failed.
=ADRESS(MAX(D2:D3600);4;1;1)
...in order to check the 4th row "D" for the line number of the cell containing the maximum value.
In my case the global maximum value is 900, and it is found in line 830.
So I need to get $D$830 and not $D$900

This will find the minimum value after the maximum value in column D
=MIN(INDEX(D:D,MATCH(MAX(D:D),D:D,0)):D1048576)

Related

In excel how to match the given input between min and max age colums

I have an Excel file were I have 3 columns. I will explain the steps:
Step 1: I will be giving an input age (eg: 25).
Step 2: Then we need to match the minimum and maximum column .
Step 3: Once matched the value it should return from age group (eg 25-35). Multiple age groups can also be returned.
I need help with this Excel formula.
I have tried index match but no success.
There might be an easier way, but this is an option:
=INDEX($A$2:$A$8,MATCH(MINIFS($C$2:$C$8,$C$2:$C$8,">="&F33),$C$2:$C$8))
(where F33 is the cell with the age)
Explanation:
=MINIFS($C$2:$C$8,$C$2:$C$8,">="&F33)
This returns the minimum value which is greater than the given age in the table. I tried to use this function to directly return the range name, but it doesn't work; it only returns a number. So from the second range, it picks all the values which satisfy the condition, and then returns the corresponding (same row) value from the first range. E.g.: if age=52, from the second range it will pick 55 and 60 (just as filters), and then take the minimum value from the last two rows of the first range (55).
=MATCH(MINIFS(...),$C$2:$C$8)
Looks for the MINIFS result value (55) in the range and returns the row index; 6 in this case. First row is 1, and remember it's relative to the range, not the whole sheet.
=INDEX($A$2:$A$8,MATCH(...))
Just picks rows 6 from the given range.

How to find multiple minimum values in excel without repeating?

Image:
In Excel, column J has a formula IF(H32>0,D32,MIN($S$32:S32)). For MIN($S$32:S32)), it is finding the lowest value in column S. However, if you see cell J39, it repeats using the same minimum value in J37.
I am looking to modify the function I created where the minimum value won't repeat itself. For example, the next minimum after 57.87 in column S is 75.82. Therefore, 75.82 should appear in cell J39.
You can use the RANK formula for this. With RANK, you can choose the n-th minimum value from Column S.

Count total number of workers based on today's date updating automatically every day

I'm a bit stumped on how to create a formula that can count the total number of workers today and update automatically every day.
Looking at the image below, I want to create a formula that will look at Row 10, determine today's date and look at Row 39 to determine how many workers I had for that day.
For example, if I look at today's date on the image Cell AZ10 and then scroll down and look at total workers for the day Cell AZ39 it should be 6. When the next day comes, 2018-03-05, I would like the cell to automatically update to the number of workers for that day, which would be 7.
Any help would be greatly appreciated. Thank you!
You can use the HLOOKUP function (Horizontal Lookup) to obtain the value you require.
For example, assuming that your data occupies the range from AZ10 to BZ39, the following formula will obtain the number of workers present today:
=HLOOKUP(TODAY(),AZ10:BZ39,30,FALSE)
Here the arguments are as follows:
TODAY() returns today's date
AZ10:BZ39 is the range of cells whose first row contains the lookup value and which also contains a row whose value is to be returned.
30 is the number of row whose value is to be returned (relative to the supplied range).
FALSE means there must be an exact match between the cell value in the first row of the supplied range and the supplied lookup value.
The HLOOKUP function is looking along row AZ for a value which exactly matches (because of the FALSE parameter) today's date (as returned by TODAY()). If such a value is found, the function will then return the value found in row 30 of the range - that is, in row 39 of your worksheet.

Excel Formula: Return value from array with multiple criteria

Suppose the following series:
I am trying to find the latest non 1 value that precedes the latest 1.
In this case it should return 3 and not 4.
1 being the minimum value I have tried to use MATCH(MIN(range),range,0) and add 1 to get the value I needed, but the minimum function gets stuck on the first occurrence of the minimum.
Try
=INDEX(B1:P1,1,MATCH(1,(OFFSET(B1:P1,,-1)=1)*(B1:P1>1),0))
Where B1:P1 is your data range. Of course it is an array formula (SHIFT+ENTER).
Hope that helps.
I can't see a short and snappy answer to this but here is one suggestion assuming the data starts in column A
=INDEX(2:2,AGGREGATE(15,6,COLUMN(INDEX(2:2,MATCH(1,2:2,0)):INDEX(2:2,MATCH(999,2:2)))/(INDEX(2:2,MATCH(1,2:2,0)):INDEX(2:2,MATCH(999,2:2))>1),1))
If the range didn't start in column A, you would have to subtract the number of the column before the first column of the range from the column number returned by the AGGREGATE to get the correct index value relative to the start of the array e.g. for B2:Z2
=INDEX(B2:Z2,AGGREGATE(15,6,COLUMN(INDEX(B2:Z2,MATCH(1,B2:Z2,0)):INDEX(B2:Z2,MATCH(999,B2:Z2)))/(INDEX(B2:Z2,MATCH(1,B2:Z2,0)):INDEX(B2:Z2,MATCH(999,B2:Z2))>1),1)-COLUMN(A:A))
To be honest it wouldn't be worth using a MATCH to find the last number in the range unless the number of cells in the range was very large, so the formula for B2:Z2 would just be
=INDEX(B2:Z2,AGGREGATE(15,6,COLUMN(INDEX(B2:Z2,MATCH(1,B2:Z2,0)):Z2)/(INDEX(B2:Z2,MATCH(1,B2:Z2,0)):Z2>1),1)-COLUMN(A:A))
Formula starting column A
Formula starting at column B

How to Find a Max and then see which column it is attributed to

I am taking a max value between CD2 and CR2 using =MAX(CD2:CR2) and instead of going through manually to find which column holds the max, is there a way for it to return this value?
Thanks!
Use the MATCH function.
For example, the following formula returns address of first entry of max value in range CD2:CR2 (returns $CF$2 for max in CF2):
=CELL("address",INDEX(CD2:CR2,1,MATCH(MAX(CD2:CR2),CD2:CR2,0)))
Alternatively you can return relative column number (starting from CD):
=MATCH(MAX(CD2:CR2),CD2:CR2,0)
i.e. formula returns 3 for above image - since CF - 3rd column from CD
For absolute column number:
=COLUMN($CD$2)+MATCH(MAX(CD2:CR2),CD2:CR2,0)-1
and non-volatile version:
=COLUMNS($A$2:$CD$2)+MATCH(MAX(CD2:CR2),CD2:CR2,0)-1
both formulas return 84 for max in CF2.
Consider:
=MID(CELL("address",INDEX(CD2:CR2,1,MATCH(MAX(CD2:CR2),CD2:CR2,0))),2,2)

Resources