• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Changing a formula to now use checkboxes, COUNTIF?

ang_smiles

New Member
Hi,

As it is now in my workbook, I have sample names in column A/B, and if certain samples are going to be taken forward (i.e. moved to the second sheet), the user places a "1" in column C. I'd like to replace the "1" column with checkboxes, which I've already linked to the cells. The problem is, when using the "1's," the cells were able to sum very easily which kept the samples in a certain order on the second sheet. If I use the checkboxes, however, the old formula (with all the tweaks I've tried) doesn't work because there's nothing to sum.

I also tried =COUNTIF(A2:A42, TRUE), and that worked for what I needed it to do, but the count was in reverse order (i.e. 10, 9, 8, 7, 6, 5, 4, 3, 2, 1). I want it to be 1, 2, 3, etc, so that it matches up with the formula I have on the second sheet. I searched the forum for reversing the order, but the answer I found (http://chandoo.org/forum/threads/for-countif-reverse-order.6056/) didn't make sense to me because of my using the checkboxes.

I also tried another solution from another thread, which was to enter the formula in the bottom cell and then fill UP the column, and that got it to count in the correct order, but still counted even if the cell was unchecked (i.e. with five cells, with #1, 2, and 4 checked, the COUNTIF result was 1, 2, 2, 3, 3... I'd want it to do 1, 2, blank, 3, blank... make sense?)

The attached workbook should explain it further.
 

Attachments

Hmm... tried it, but it doesn't sum/add in ascending order (i.e. 1, 2, 3, 4). If the box is checked, it just puts a "1" for each sample in column D (i.e. 1, 1, 1, 1)
 
Wait! That'll work. I can just add a "helper" column, say F, in which the formula in column F will be the same as the old formula in column D.

Thank you very much!
 
Hi ,

I really do not know what your problem is , but you do not need to use any helper columns ; if you change your formulae on the Worksheet tab , you can get what you want.

Narayan
 
I was able to do it by changing the formula in column D to IF(C2=TRUE,1,"*"), and then added a new column which just had the original formula in column D. It wasn't working before, but now I've got it.

Thanks for your responses, sometimes it just takes a little "eureka" moment I guess!
 
Back
Top