326
General Software Discussion / Re: Test cell value for BLANK in Excel and take action (or not) based on it
« on: September 11, 2015, 01:38 AM »
OK, let see what we can do here....
the simple answer is to substitute the formulas in columns C and D for the XXXX so the formula now becomes
C3=if(trim(a3&B3) = "","",(LEFT(md5hash(A3&B3),8))
of course this doesn't cater for the situation where the (damn!!) user enters the same value twice, so
C3=if(trim(a3&B3) = "","",if(trim(A3) = trim(B3), "GODAMMIT, I TOLD YOU NOT TO PUT THE SAME VALUE IN BOTH FIELDS, NOW GO BACK AND DO IT PROPERLY",(LEFT(md5hash(A3&B3),8))
this will test if the fields match (and prompt the user), or are empty, and do nothing). Match this up with some conditional formatting and you've got a pretty good flag
Of course as IanB pointed out data quality is a key consideration, eg what are the criteria for generating the values in Ax and Bx? Do they have to be numeric, or alpha, or alphanumeric? Do they have to be a certain length, or within a set length (ie 6 to 8 chars), and so on. Answering those questions in as much detail as possible will enable you too better refine the rulesets
the simple answer is to substitute the formulas in columns C and D for the XXXX so the formula now becomes
C3=if(trim(a3&B3) = "","",(LEFT(md5hash(A3&B3),8))
of course this doesn't cater for the situation where the (damn!!) user enters the same value twice, so
C3=if(trim(a3&B3) = "","",if(trim(A3) = trim(B3), "GODAMMIT, I TOLD YOU NOT TO PUT THE SAME VALUE IN BOTH FIELDS, NOW GO BACK AND DO IT PROPERLY",(LEFT(md5hash(A3&B3),8))
this will test if the fields match (and prompt the user), or are empty, and do nothing). Match this up with some conditional formatting and you've got a pretty good flag
Of course as IanB pointed out data quality is a key consideration, eg what are the criteria for generating the values in Ax and Bx? Do they have to be numeric, or alpha, or alphanumeric? Do they have to be a certain length, or within a set length (ie 6 to 8 chars), and so on. Answering those questions in as much detail as possible will enable you too better refine the rulesets