How to copy countif formula without changing cell #s?

MsCynic

Board Regular
Joined
May 21, 2006
Messages
122
Hi guys, I often need to count names and data in a worksheet. I use the countif function to establish, for example, how many times Amy, Carla, Tanya and Bob's names appear in the sheet and from this I calculate a staff incentive.

This is how it looks: =COUNTIF(A1:A107,"*amy")

I want to be able to drag and copy this formula onto several cells below, changing only the name, but Excel always increases the cell numbers so I end up with:

=COUNTIF(A4:A111,"*bob"

Is there a way to drag and copy this formula without changing the cell numbers?

Thanks in advance for advice,
Jo
 

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.
put dollar signs around your cell references:

=COUNTIF($A$1:$A$107,"*amy")

that's called absolute reference. The dollar sign in front of the Column locks the column, and in front of the row locks the row.

Play around with different combinations (such as A1:$A$107) and fill your formula in different directs to see what affect it has. Absolute references and different combos of them are extremely useful.

When you're in the formula bar, pushing F4 automatically makes the cell reference absolute. Pushing it repeatedly will cycle you through the different combinations
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,439
Messages
6,191,045
Members
453,635
Latest member
nathanw90

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