Combine a Countif with an Offset

Caveman1964

Board Regular
Joined
Dec 14, 2017
Messages
127
Office Version
  1. 2016
Platform
  1. Windows
I have tried this every way I could.....I can't get to work but they work seperately.
=countif('Data Collection'!$d$7:$D:$2000,"GA")
=offset('data Collection'!$D$6,1,,2000)

D6 is the header. the data begins D7, but when I insert new row, I lose my data for my chart. The formula moves with it. But the two up above work but I can't get them to work together.
Been working on this for hours, please help.
Any help appreciated.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Caveman,

It's not clear what you're trying to achieve with these functions, can you post some sample data showing what you want the end result to be?
 
Upvote 0
Sure!
I hope this helps. I don't know much what I am doing but trying to learn.
This is not working well trying to put in this forum.....I am sure there is a better way to do it.
I need one sheet to count the number of times GA shows up in column "Location" which is D beginning at row 7......on sheet 3.
However, I enter new info by inserting into row 7 new info where a new location shows up which will be one of the 4 shown. But my countif on sheet 4 changes and starts to count from row 8 of sheet 2 instead of 7. Every time I enter new, the countif changes down again. I need it to continue to count from D7 sheet two.
I know I am not explaining this well. but I sure hope you can see what I am trying to do.
Thank You

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]JOB[/TD]
[TD]location[/TD]
[TD][/TD]
[TD][/TD]
[TD]different sheet[/TD]
[TD]location[/TD]
[TD]amount of jobs[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]123456[/TD]
[TD]GA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]GA[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7827852[/TD]
[TD]AL[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]AL[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]785272[/TD]
[TD]GA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]FL[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]389373[/TD]
[TD]FL[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]SC[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]373872[/TD]
[TD]SC[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]GA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]SC[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Hi Caveman,

You could use this dynamic named range with the offset function below and plug that into your countif if.

Note how the offset formula starts before D7 where you are inserting your new row, thus expanding the countif;


Book1
CD
6JOBlocation
7123456AL
8789456AL
9589634GA
10123456GA
117827852AL
12785272GA
13389373FL
14373872SC
15GA
16SC
Sheet3



Book1
AB
1locationamount of jobs
2GA4
3AL3
4FL1
5SC2
Sheet2
Cell Formulas
RangeFormula
B2=COUNTIF(location,Sheet2!A2)
Named Ranges
NameRefers ToCells
location=OFFSET(Sheet3!$D$6,,,COUNTA(Sheet3!$D:$D))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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