himperson1
New Member
- Joined
- Jun 23, 2016
- Messages
- 33
Hello. I'm looking for some help with the following:
I need to find the mode of an array that changes based on the day of the month and which shift im looking at.
Ex:
<tbody>
</tbody>
If I wanted to find the mode of 1st shift until the 3rd of the month, the output result is "Empty"
The array it is looking at would be {Empty, 0, 0, Max, 0, 0, Empty, 0, 0}
If I wanted to find the mode of 2nd shift until the 2nd of the month, the output result is "Min"
The array it is looking at would be {0, Min, 0, 0, Min, 0}
I have found the following code to potentially use, but I am having difficulties making it fit my spreadsheet.
I use the following code elsewhere in my spreadsheet to find the sum of a similar array
Thank you
I need to find the mode of an array that changes based on the day of the month and which shift im looking at.
Ex:
Day | 1 | 1 | 1 | 2 | 2 | 2 | 3 | 3 | 3 |
Shift | 1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 |
Level | Empty | Min | Min | Max | Min | Max | Empty | Max | Max |
<tbody>
</tbody>
If I wanted to find the mode of 1st shift until the 3rd of the month, the output result is "Empty"
The array it is looking at would be {Empty, 0, 0, Max, 0, 0, Empty, 0, 0}
If I wanted to find the mode of 2nd shift until the 2nd of the month, the output result is "Min"
The array it is looking at would be {0, Min, 0, 0, Min, 0}
I have found the following code to potentially use, but I am having difficulties making it fit my spreadsheet.
Code:
= INDEX(rng,MODE(IF(rng<>"",MATCH(rng,rng,0))))
I use the following code elsewhere in my spreadsheet to find the sum of a similar array
Code:
=SUMPRODUCT(--(MOD(COLUMN(INDIRECT("'MS'!E"&MS!$A$35&":"&A$1&MS!$A$35))-COLUMN(INDIRECT("'MS'!E"&MS!$A$35))+1,3)=1),INDIRECT("'MS'!E"&MS!$A$35&":"&A$1&MS!$A$35))
Thank you