Minus the results from the previous columns?

phairplay

Active Member
Joined
Nov 2, 2011
Messages
260
Hi,

I'm using the below vba code to populate a value in the next empty for 12 difference rows


example:
Code:
Range("E6").End(xlToRight).Offset(0, 1).Value = "=COUNTIF('BoM Data'!C10,""Y"")"


what I would like to do is minus off all the previous results in the row after E6 so I can see how many "Y" have been added since it was last ran.


can someone please help
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I am a bit confused. In your formula, it looks like you are counting values from a different row on a different sheet.
(And it is odd to use COUNTIF on a single cell as opposed to a whole range).

Can you explain your data structure a bit more, and exactly what you are trying to do?
Post some images, if it helps in your description. You cannot upload files to this site. But there are tools you can use to post screen images. They are listed in Section B of this link here: Guidelines for Forum Use. Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.
 
Upvote 0
Sorry I don't know why it's like that it looks for all "Y" in column J on another sheet

E6 has the starting result

When I run the above it will populates the countif in the next empty cell in row 6. What I would like it to do is sum up the previous results (D6:last used column) and remove it from the total so i can see how many more "Y" there are since the last time it ran.
 
Upvote 0
I am still not certain if I 100% follow, but see if this helps.

Here is an equation that will add a column at the end of row 6 to count all the "Y"s from column D to the last column (just before where it is inserting the value):
Code:
    Range("E6").End(xlToRight).Offset(0, 1).Value = "=COUNTIF(RC4:RC[-1],""Y"")"
Does that help?
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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