MEUserII
Board Regular
- Joined
- Oct 27, 2017
- Messages
- 91
- Office Version
- 365
- 2021
- 2019
- 2016
- 2013
- Platform
- Windows
Consider the following array, {1, 2, 3, 4, 5, 6, 7, 8, 9}, is there a way that I can return the positions of the values in a separate array that match a certain criteria?
For example, if I wanted just the positions of the even values from this example array, {1, 2, 3, 4, 5, 6, 7, 8, 9}, the positions of the even values as an array would be: {2, 4, 6, 8}, where "{2, 4, 6, 8}" represent the positions of each of the even values in the example array as positions: second position, fourth position, sixth position, and eighth position.
Is there a way to do this via formula to do this?
More generally, taking the example array of: {0, 1, 0, 1, 0, 1, 0, 1, 0}; would there be a way via formula to return the positions of the "1" values of that array which would be the array of: {2, 4, 6, 8}; where "{2, 4, 6, 8}" represent the: second position, fourth position, sixth position, and eighth position?
For reference, I need to be able to return the positions of the values of an array as a separate array for use with the following formula:
=INDEX( RANGE, N( IF(1,{2, 4, 6, 8} ) ) )
For reference on this formula see: https://exceljet.net/formula/return-array-with-index-function
For example, if I wanted just the positions of the even values from this example array, {1, 2, 3, 4, 5, 6, 7, 8, 9}, the positions of the even values as an array would be: {2, 4, 6, 8}, where "{2, 4, 6, 8}" represent the positions of each of the even values in the example array as positions: second position, fourth position, sixth position, and eighth position.
Is there a way to do this via formula to do this?
More generally, taking the example array of: {0, 1, 0, 1, 0, 1, 0, 1, 0}; would there be a way via formula to return the positions of the "1" values of that array which would be the array of: {2, 4, 6, 8}; where "{2, 4, 6, 8}" represent the: second position, fourth position, sixth position, and eighth position?
For reference, I need to be able to return the positions of the values of an array as a separate array for use with the following formula:
=INDEX( RANGE, N( IF(1,{2, 4, 6, 8} ) ) )
For reference on this formula see: https://exceljet.net/formula/return-array-with-index-function
Last edited: