When adding data to blank row of a table, dynamic criteria range formula changes

Erik F

New Member
Joined
May 26, 2016
Messages
10
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD]Column G
[/TD]
[TD]Column H
[/TD]
[TD]Column P
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Report #
[/TD]
[TD]Status
[/TD]
[TD]Name
[/TD]
[TD]Employee ID #
[/TD]
[TD]# of Reports
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]1-1
[/TD]
[TD]APPROVED
[/TD]
[TD]Adam A
[/TD]
[TD]11
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]1-2
[/TD]
[TD]APPROVED
[/TD]
[TD]Charlie C
[/TD]
[TD]22
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]2-1
[/TD]
[TD]APPROVED
[/TD]
[TD]Bravo B
[/TD]
[TD]33
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]3-1
[/TD]
[TD]APPROVED
[/TD]
[TD]Charlie C
[/TD]
[TD]22
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]4-1
[/TD]
[TD]VOIDED
[/TD]
[TD]Adam A
[/TD]
[TD]11
[/TD]
[TD]VOIDED
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]4-2
[/TD]
[TD]APPROVED
[/TD]
[TD]Adam A
[/TD]
[TD]11
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]4-3
[/TD]
[TD]APPROVED
[/TD]
[TD]Adam A
[/TD]
[TD]11
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD]5-1
[/TD]
[TD]PENDING
[/TD]
[TD]Bravo B
[/TD]
[TD]33
[/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]

(This is a TABLE)

Hello and THANK YOU in advance,

Column 'P' keeps a continuous count of how many reports the employee files not including the ones that were voided. I added Column P after I added all the data. I put the formula into Cell P2, dragged it down to the last entry and HURRAY!!! IT WORKS GREAT..., almost :(
When I add new data into the next blank row (Row10+) it changes the end criteria range (for the old last row and all added rows) to the last cell in the table instead of it's own cell. Instead of giving me a continuous count for each employee it starts giving me the total count for each employee.

Before:
Cell P8 =IF(B8="VOIDED","VOIDED",COUNTIFS(B$2:B8,"<>VOIDED",H$2:H8,H8)
Cell P9 =IF(B9="VOIDED","VOIDED",COUNTIFS(B$2:B9,"<>VOIDED",H$2:H9,H9)
After:
Cell P8 =IF(B8="VOIDED","VOIDED",COUNTIFS(B$2:B8,"<>VOIDED",H$2:H8,H8)
Cell P9 =IF(B9="VOIDED","VOIDED",COUNTIFS(B$2:B10,"<>VOIDED",H$2:H10,H9) **Error Inconsistent Calculated Column Formula
Cell P10 =IF(B10="VOIDED","VOIDED,COUNTIFS(B$2:B10,"<>VOIDED",H$2:H10,H10)

EG:
Row 10 David D=1

Row 10 David D=2
Row 11 David D=2

I know I can just extend the formula after I add new data, but I am designing this for a dozen other offices who will fill out the sheet for data pertaining to their specific office and EXCEL bewilders them (just like VBA bewilders me--hint-hint).

P.S. There re a lot more columns (A:BE) and worksheets (10). 1/3 of the columns have formulas and all the worksheets pull data from this worksheet/table. I intend to lock and protect the formula columns and worksheets.

Thank you so much. MREXCEL RULES!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
SOLVED!

=IF([@STATUS]="VOIDED","VOIDED,COUNTIF(INDIRECT("K1:K"&ROW()-1),INDIRET("K"&ROW())))

Thanks to my guy JoeT, from work.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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