Delete data with blank or zero values

Speed boy

New Member
Joined
Apr 2, 2002
Messages
29
I've always used the VBA autofilter solution to find zero values then delete target row. Works great and is fast...
Now I'm facing a new quandary with additional data elements

Col A Col B Col C Jan Feb Mar Apr
Client A Product 1 Actual Sales 0 0 0 0
Client A Product 1 Forecast Sales 0 0 0 0
Client A Product 1 Estimated Sales 0 0 0 0
Client A Product 1 Year Ago Sales 0 0 0 0

So in the above example where I have multiple clients and products I would like to delete all rows where Product 1 totals a zero value across all sales measure for all time periods.

Should Product 1 be zero for Actual Sales but has values for Year ago Sales it should remain in its entirety. All 4 measures remain.

Any help is always greatly appreciated and paid forward.

SB
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
OK, this can be done with the use of a few "helper" columns.
Let me set up an example for you.

Let's say that we have data in your layout, where the data starts in cell A2 and goes to G17 (where column G is your April column).

First Helper Column:
Get a total for each row.
So, in cell H2, I entered the formula and copied down for all rows:
=SUM(D2:G2)

Second Helper Column:
Get a total for each Client/Product combination.
So, in cell I2, I entered the formula and copied down for all rows:
(if you have Excel 2007 or newer): =SUMIFS(H$2:H$17,A$2:A$17,A2,B$2:B$17,B2)
(if you have an older version of Excel): =SUMPRODUCT(--(A$2:A$17=A2),--(B$2:B$17=B2),--(H$2:H$17))

So, now you can use column I as your "filter" column, basically deleting the rows with a zero in this column.
 
Last edited:
Upvote 0
Thanks Joe4... Where you say Access do you mean Excel? Was worried I may have posted to the wrong forum as I use Access a lot too. Can't wait to try your formula solution... Will try first thing Monday.

Thanks again and have a wonderful Easter
 
Upvote 0
Where you say Access do you mean Excel? Was worried I may have posted to the wrong forum as I use Access a lot too
Yes, it should say Excel, not Access (I went back and fixed the typo). Sorry about that, I use both a lot, so I must have had Access on the brain as I was typing.

Happy Easter to you too!
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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