Mix of values in rows

Urban

New Member
Joined
Feb 22, 2011
Messages
3
Is there a way to write a single formula that returns true if any row in an array has a mix of numeric and alpha values?

Example that returns false:
0, 1, 2
a, b, c

Example that returns true:
3, 4, d
e, f, g
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hello Urban, and welcome to the Board!
There are likely many ways to solve this problem in Excel, so others will likely chime in with their approach...here's one that uses the distinction between Count() and Counta().
Since your example uses 3 values, but your question was more general, the formula given is adaptable to any range of cells without modification other than changing the range reference in the 4 locations.
Code:
=IF(OR(COUNT(E3:G3)= COUNTA(E3:G3),AND(COUNT(E3:G3)=0,COUNTA(E3:G3)>0)),"Uniform","Mixed")
The formula above is for data in cells E3:G3...but could be any range that you can populate into the 4 spots in the formula.
Hope that helps,
Cindy
Just noticed that you need True if it's mixed, false otherwise...I'll tweak the formula and post back.
 
Last edited:
Upvote 0
OK...this reverses the logic (and tests it on a larger range, E3:I3):
Code:
=IF(AND(COUNT(E3:I3)<> COUNTA(E3:I3),COUNT(E3:I3)<>0),TRUE,FALSE)

Hope that works for you,
Cindy
 
Upvote 0
Thanks for the reply. Initially I thought that what you had was what I wanted, but looking again I don't think so.

The data I have is not a single row. I have multiple rows and I am trying to check if any single row in the set of rows I am evaluating has a mix of alpha and numeric values.

Example #1:
0, 1, 2
a, b, c
This example should return false because neither row has a mix of alpha and numerics. The fact that row #1 is all numeric and #2 is all alpha is fine.

Example #2:
3, 4, d
e, f, g
This example should return true because the first row has a mix of alpha and numeric. Row #2 is all alpha which is good, but row #1 isn't so overall the two rows fail.

I was able to add a true/false formula to each row and then one cell for the whole block that checks if any row returns true and if so the whole thing is true. I also created a VBA option. But I would like to do this all with a formula in one cell if possible.

Thanks for the help.
 
Upvote 0
Is it always just 2 rows, with a variable number of columns? Or are you looking for a formula that would be readily adapted to multiple rows (more difficult, but will probably require a different approach)?
 
Upvote 0

Forum statistics

Threads
1,224,576
Messages
6,179,639
Members
452,935
Latest member
mm1t1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top