Seeking a better way to CountIF with dynamic range without dragging cells down columns.

Poker Joe

New Member
Joined
Feb 12, 2015
Messages
30
Office Version
  1. 2019
Platform
  1. Windows
The preview sheet is a small sample of a much larger worksheet but it gives an idea of what I'm trying to figure out.


Is there a better way to CountIf without typing in the CountIf Function in the top row of cells, adjusting all the cell addresses, then selecting the top row of formulas and dragging them down the sheet?

Essentially, I have the CountIf Range values (Integers) starting in C10:G LastRow or cells (10,3), cells (LastRow, 7).

The first two columns are an ID number and Date. They're not part of the CountIf Range.

The criterias of the CountIf function are in I9:AY9. Each cell is a criteria. Criteria values are Integers. They are static $I$9, $J$9, $K$9, etc.

The Formulas start in I53 through AY53. I want to CountIf the values of the -43 rows, Range, with criteria values in I9 through AY9.

The -43 rows would be dynamic as I drag the selected cells down the spreadsheet.

Additionally, I'd like to go two rows past the LastRow of range data. This would give me an idea of criteria results before filling in the data of the LastRow.

Thanks in advance to anyone that can crack this. ChatGPT gave up. I explained it a thousand ways. No help or I can't vibe with AI. That's fine.

If you prefer to do something simple using the preview, I can probably edit it with the cell addresses, row count, etc. I need for the larger worksheet. I had to zoom down too small to use it as a preview showing formulas.

Book2.xlsx
ABCDEFGHIJKLMNOPQR
8Larger worksheet has Integers (criteria) from 1 to 43, I9:AY9
9ID1DateC1C2C3C4C512345678910
1014492736958
11244928589105
1234492912422Formulas shows last -5 rows,
13444930456610 I really need last -43 rows for
14544931610277larger worksheet.
1564493282438=COUNTIF($C10:$G14,$I$9)=COUNTIF($C10:$G14,$J$9)=COUNTIF($C10:$G14,$K$9)=COUNTIF($C10:$G14,$L$9)=COUNTIF($C10:$G14,$M$9)=COUNTIF($C10:$G14,$N$9)=COUNTIF($C10:$G14,$O$9)=COUNTIF($C10:$G14,$P$9)=COUNTIF($C10:$G14,$Q$9)=COUNTIF($C10:$G14,$R$9)
1674493356952=COUNTIF($C11:$G15,$I$9)=COUNTIF($C11:$G15,$J$9)=COUNTIF($C11:$G15,$K$9)=COUNTIF($C11:$G15,$L$9)=COUNTIF($C11:$G15,$M$9)=COUNTIF($C11:$G15,$N$9)=COUNTIF($C11:$G15,$O$9)=COUNTIF($C11:$G15,$P$9)=COUNTIF($C11:$G15,$Q$9)=COUNTIF($C11:$G15,$R$9)
1784493427661=COUNTIF($C12:$G16,$I$9)=COUNTIF($C12:$G16,$J$9)=COUNTIF($C12:$G16,$K$9)=COUNTIF($C12:$G16,$L$9)=COUNTIF($C12:$G16,$M$9)=COUNTIF($C12:$G16,$N$9)=COUNTIF($C12:$G16,$O$9)=COUNTIF($C12:$G16,$P$9)=COUNTIF($C12:$G16,$Q$9)=COUNTIF($C12:$G16,$R$9)
18944935103474=COUNTIF($C13:$G17,$I$9)=COUNTIF($C13:$G17,$J$9)=COUNTIF($C13:$G17,$K$9)=COUNTIF($C13:$G17,$L$9)=COUNTIF($C13:$G17,$M$9)=COUNTIF($C13:$G17,$N$9)=COUNTIF($C13:$G17,$O$9)=COUNTIF($C13:$G17,$P$9)=COUNTIF($C13:$G17,$Q$9)=COUNTIF($C13:$G17,$R$9)
19104493675186=COUNTIF($C14:$G18,$I$9)=COUNTIF($C14:$G18,$J$9)=COUNTIF($C14:$G18,$K$9)=COUNTIF($C14:$G18,$L$9)=COUNTIF($C14:$G18,$M$9)=COUNTIF($C14:$G18,$N$9)=COUNTIF($C14:$G18,$O$9)=COUNTIF($C14:$G18,$P$9)=COUNTIF($C14:$G18,$Q$9)=COUNTIF($C14:$G18,$R$9)
20114493786417=COUNTIF($C15:$G19,$I$9)=COUNTIF($C15:$G19,$J$9)=COUNTIF($C15:$G19,$K$9)=COUNTIF($C15:$G19,$L$9)=COUNTIF($C15:$G19,$M$9)=COUNTIF($C15:$G19,$N$9)=COUNTIF($C15:$G19,$O$9)=COUNTIF($C15:$G19,$P$9)=COUNTIF($C15:$G19,$Q$9)=COUNTIF($C15:$G19,$R$9)
2112449382710110=COUNTIF($C16:$G20,$I$9)=COUNTIF($C16:$G20,$J$9)=COUNTIF($C16:$G20,$K$9)=COUNTIF($C16:$G20,$L$9)=COUNTIF($C16:$G20,$M$9)=COUNTIF($C16:$G20,$N$9)=COUNTIF($C16:$G20,$O$9)=COUNTIF($C16:$G20,$P$9)=COUNTIF($C16:$G20,$Q$9)=COUNTIF($C16:$G20,$R$9)
22134493918943=COUNTIF($C17:$G21,$I$9)=COUNTIF($C17:$G21,$J$9)=COUNTIF($C17:$G21,$K$9)=COUNTIF($C17:$G21,$L$9)=COUNTIF($C17:$G21,$M$9)=COUNTIF($C17:$G21,$N$9)=COUNTIF($C17:$G21,$O$9)=COUNTIF($C17:$G21,$P$9)=COUNTIF($C17:$G21,$Q$9)=COUNTIF($C17:$G21,$R$9)
23144494041366=COUNTIF($C18:$G22,$I$9)=COUNTIF($C18:$G22,$J$9)=COUNTIF($C18:$G22,$K$9)=COUNTIF($C18:$G22,$L$9)=COUNTIF($C18:$G22,$M$9)=COUNTIF($C18:$G22,$N$9)=COUNTIF($C18:$G22,$O$9)=COUNTIF($C18:$G22,$P$9)=COUNTIF($C18:$G22,$Q$9)=COUNTIF($C18:$G22,$R$9)
24154494169574=COUNTIF($C19:$G23,$I$9)=COUNTIF($C19:$G23,$J$9)=COUNTIF($C19:$G23,$K$9)=COUNTIF($C19:$G23,$L$9)=COUNTIF($C19:$G23,$M$9)=COUNTIF($C19:$G23,$N$9)=COUNTIF($C19:$G23,$O$9)=COUNTIF($C19:$G23,$P$9)=COUNTIF($C19:$G23,$Q$9)=COUNTIF($C19:$G23,$R$9)
251644942754101=COUNTIF($C20:$G24,$I$9)=COUNTIF($C20:$G24,$J$9)=COUNTIF($C20:$G24,$K$9)=COUNTIF($C20:$G24,$L$9)=COUNTIF($C20:$G24,$M$9)=COUNTIF($C20:$G24,$N$9)=COUNTIF($C20:$G24,$O$9)=COUNTIF($C20:$G24,$P$9)=COUNTIF($C20:$G24,$Q$9)=COUNTIF($C20:$G24,$R$9)
261744943106734=COUNTIF($C21:$G25,$I$9)=COUNTIF($C21:$G25,$J$9)=COUNTIF($C21:$G25,$K$9)=COUNTIF($C21:$G25,$L$9)=COUNTIF($C21:$G25,$M$9)=COUNTIF($C21:$G25,$N$9)=COUNTIF($C21:$G25,$O$9)=COUNTIF($C21:$G25,$P$9)=COUNTIF($C21:$G25,$Q$9)=COUNTIF($C21:$G25,$R$9)
271844944339910=COUNTIF($C22:$G26,$I$9)=COUNTIF($C22:$G26,$J$9)=COUNTIF($C22:$G26,$K$9)=COUNTIF($C22:$G26,$L$9)=COUNTIF($C22:$G26,$M$9)=COUNTIF($C22:$G26,$N$9)=COUNTIF($C22:$G26,$O$9)=COUNTIF($C22:$G26,$P$9)=COUNTIF($C22:$G26,$Q$9)=COUNTIF($C22:$G26,$R$9)
28194494557559=COUNTIF($C23:$G27,$I$9)=COUNTIF($C23:$G27,$J$9)=COUNTIF($C23:$G27,$K$9)=COUNTIF($C23:$G27,$L$9)=COUNTIF($C23:$G27,$M$9)=COUNTIF($C23:$G27,$N$9)=COUNTIF($C23:$G27,$O$9)=COUNTIF($C23:$G27,$P$9)=COUNTIF($C23:$G27,$Q$9)=COUNTIF($C23:$G27,$R$9)
29204494668223=COUNTIF($C24:$G28,$I$9)=COUNTIF($C24:$G28,$J$9)=COUNTIF($C24:$G28,$K$9)=COUNTIF($C24:$G28,$L$9)=COUNTIF($C24:$G28,$M$9)=COUNTIF($C24:$G28,$N$9)=COUNTIF($C24:$G28,$O$9)=COUNTIF($C24:$G28,$P$9)=COUNTIF($C24:$G28,$Q$9)=COUNTIF($C24:$G28,$R$9)
30214494784485=COUNTIF($C25:$G29,$I$9)=COUNTIF($C25:$G29,$J$9)=COUNTIF($C25:$G29,$K$9)=COUNTIF($C25:$G29,$L$9)=COUNTIF($C25:$G29,$M$9)=COUNTIF($C25:$G29,$N$9)=COUNTIF($C25:$G29,$O$9)=COUNTIF($C25:$G29,$P$9)=COUNTIF($C25:$G29,$Q$9)=COUNTIF($C25:$G29,$R$9)
312244948=COUNTIF($C26:$G30,$I$9)=COUNTIF($C26:$G30,$J$9)=COUNTIF($C26:$G30,$K$9)=COUNTIF($C26:$G30,$L$9)=COUNTIF($C26:$G30,$M$9)=COUNTIF($C26:$G30,$N$9)=COUNTIF($C26:$G30,$O$9)=COUNTIF($C26:$G30,$P$9)=COUNTIF($C26:$G30,$Q$9)=COUNTIF($C26:$G30,$R$9)
322344949=COUNTIF($C27:$G31,$I$9)=COUNTIF($C27:$G31,$J$9)=COUNTIF($C27:$G31,$K$9)=COUNTIF($C27:$G31,$L$9)=COUNTIF($C27:$G31,$M$9)=COUNTIF($C27:$G31,$N$9)=COUNTIF($C27:$G31,$O$9)=COUNTIF($C27:$G31,$P$9)=COUNTIF($C27:$G31,$Q$9)=COUNTIF($C27:$G31,$R$9)
Sheet1
Cell Formulas
RangeFormula
I15:I32I15=COUNTIF($C10:$G14,$I$9)
J15:J32J15=COUNTIF($C10:$G14,$J$9)
K15:K32K15=COUNTIF($C10:$G14,$K$9)
L15:L32L15=COUNTIF($C10:$G14,$L$9)
M15:M32M15=COUNTIF($C10:$G14,$M$9)
N15:N32N15=COUNTIF($C10:$G14,$N$9)
O15:O32O15=COUNTIF($C10:$G14,$O$9)
P15:P32P15=COUNTIF($C10:$G14,$P$9)
Q15:Q32Q15=COUNTIF($C10:$G14,$Q$9)
R15:R32R15=COUNTIF($C10:$G14,$R$9)
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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