CountIF Function Help

lwilt

Board Regular
Joined
May 16, 2013
Messages
187
I'm having trouble with the countif function. In my spreadsheet in column C starting cell C2 I have text numbers. If the cell starts with an 8 I want to put a leading 0 in front of it otherwise I want to keep the cell the way it is.


Also, if possible for the cells with just a 0 in them can I turn have it write those as null cells where the function is running?

thank you
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Joe4 - I did post links...they are above in the 2nd post. The site is running a bit slow this morning for me and it took me a few mins to post them after the orig post loaded since I needed all links for each site.

Alkey...the links to the other site I upload a sample doc. I 'll paste it below for you to see.

[TABLE="width: 301"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Key[/TD]
[TD]REF POINT[/TD]
[TD][/TD]
[TD]FORMULA[/TD]
[TD][/TD]
[TD]Look like[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]11122[/TD]
[TD]11122[/TD]
[TD][/TD]
[TD][/TD]
[TD]11122[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]65644444[/TD]
[TD]65644444[/TD]
[TD][/TD]
[TD][/TD]
[TD]65644444[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]811111[/TD]
[TD]811111[/TD]
[TD][/TD]
[TD][/TD]
[TD]0811111[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2121212[/TD]
[TD]2121212[/TD]
[TD][/TD]
[TD][/TD]
[TD]2121212[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]11111[/TD]
[TD]11111[/TD]
[TD][/TD]
[TD][/TD]
[TD]11111[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]13111[/TD]
[TD]13111[/TD]
[TD][/TD]
[TD][/TD]
[TD]13111[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]15166[/TD]
[TD]15166[/TD]
[TD][/TD]
[TD][/TD]
[TD]15166[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1211111[/TD]
[TD]1211111[/TD]
[TD][/TD]
[TD][/TD]
[TD]1211111[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]447777[/TD]
[TD]447777[/TD]
[TD][/TD]
[TD][/TD]
[TD]447777[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]4545454[/TD]
[TD]4545454[/TD]
[TD][/TD]
[TD][/TD]
[TD]4545454[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]29999999[/TD]
[TD]29999999[/TD]
[TD][/TD]
[TD][/TD]
[TD]29999999[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]899666[/TD]
[TD]899666[/TD]
[TD][/TD]
[TD][/TD]
[TD]0899666[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2222221[/TD]
[TD]2222221[/TD]
[TD][/TD]
[TD][/TD]
[TD]2222221[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1111117[/TD]
[TD]1111117[/TD]
[TD][/TD]
[TD][/TD]
[TD]1111117[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Solved!!!

here was the solution
=IF(OR(C2={"","0"}),"",IF(LEFT(C2,1)="8","0"&C2,""&C2))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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