Have a Question?

If you have any question you can ask below or enter what you are looking for!



TRIM and CountIf

Can we use TRIM and Countif function together in multiple cell?

  Rupesh Kumar

Interesting question. It depends on the actual use. Now if you want to nest the Trim function in criteria range of the countif function then it wont accept since criteria range of COUNTIF function must be a range either generated of a named manager or can be hardcoded. But you can easily use the trim function in criteria range.

The second scenario - You may want to wrap the countif function with Trim function, this scenario has no real time significance becasue countif function would generate a number which will not have any extra spaces with it. In simple words COUNTIF function generates numeric values(also known as Long in Excel) thus TRIM function holds no use. You would use TRIM function only if COUNTIF yielded you a text result.

Last but not least, I would suggest to post your question with an example along with required result..We shall share the best fit solution.


  Asheesh Mattoo       18 Jul 2016       3       0     

Ignore the above reply - some minor mistake, I couldnt edit the above response there re-posting the edited version:

Interesting question. It depends on the actual use. Now if you want to nest the Trim function in criteria range of the countif function then it wont accept since criteria range of COUNTIF function must be a range either generated of a named manager or can be hardcoded. But you can easily use the trim function in criteria(2nd argument of countif function) 


The second scenario - You may want to wrap the countif function with Trim function, this scenario has no real time significance becasue countif function would generate a number which will not have any extra spaces with it. In simple words COUNTIF function generates numeric values(also known as Long in Excel) thus TRIM function holds no use. You would use TRIM function only if COUNTIF yielded you a text result with extra spaces.

Last but not least, I would suggest to post your question with an example along with the required result..We shall share the best fit solution

  Asheesh Mattoo       18 Jul 2016       2       0     

Post Your Answers:

Please use the CODE HIGHLIGHT Button to format/highlight your codes if any