Forum Discussion
Extract number values from column
- 9 years ago
Anonymous
Hi, looks this link:
http://www.excelguru.ca/blog/2015/11/19/keep-only-numbers-in-power-query/
we don't have power query as an option - so we've needed to be a little more manual.
our scenario only went to a max of ten characters. it's a little messy and I'm sure that the ISERROR isn't the best as far as performance goes.
I'm sure there will be many out there screaming NO!! at this :)
VAR Key1 =
MID ( TableName[Cost], 1, 1 )
VAR Key2 =
MID ( TableName[Cost], 2, 1 )
VAR Key3 =
MID ( TableName[Cost], 3, 1 )
VAR Key4 =
MID ( TableName[Cost], 4, 1 )
VAR Key5 =
MID ( TableName[Cost], 5, 1 )
VAR Key6 =
MID ( TableName[Cost], 6, 1 )
VAR Key7 =
MID ( TableName[Cost], 7, 1 )
VAR Key8 =
MID ( TableName[Cost], 8, 1 )
VAR Key9 =
MID ( TableName[Cost], 9, 1 )
VAR Key10 =
MID ( TableName[Cost], 10, 1 )
VAR MyNumber =
IF ( ISERROR ( VALUE ( Key1 ) ) = FALSE (), Key1, "" )
& IF ( ISERROR ( VALUE ( Key2 ) ) = FALSE (), Key2, "" )
& IF ( ISERROR ( VALUE ( Key3 ) ) = FALSE (), Key3, "" )
& IF ( ISERROR ( VALUE ( Key4 ) ) = FALSE (), Key4, "" )
& IF ( ISERROR ( VALUE ( Key5 ) ) = FALSE (), Key5, "" )
& IF ( ISERROR ( VALUE ( Key6 ) ) = FALSE (), Key6, "" )
& IF ( ISERROR ( VALUE ( Key7 ) ) = FALSE (), Key7, "" )
& IF ( ISERROR ( VALUE ( Key8 ) ) = FALSE (), Key8, "" )
& IF ( ISERROR ( VALUE ( Key9 ) ) = FALSE (), Key9, "" )
& IF ( ISERROR ( VALUE ( Key10 ) ) = FALSE (), Key10, "" )
RETURN
IF(MyNumber = "", BLANK(), VALUE(MyNumber))
- Anonymous9 years agoNot applicable
Thanks for the info Dog!