Count the non blank cells in a row occurring after a ">0" value between two dates

ashisha155

New Member
Joined
Oct 17, 2011
Messages
7
I have been provided the daily sales data to track the post price revision performance of a product in different areas with different launch dates, now I've to calculate the no. of visits of the salesperson after the launch, that means I want to count the non blank cells occurring after the ">0" value in a row between two given dates:

Salesperson 1-Aug 2-Aug 3-Aug 4-Aug 5-Aug 6-Aug LaunchDate Result
A 0 10 0 5 0 12 3-Aug 2
B 0 20 0 2-Aug 1
C 4 0 5 0 0 4-Aug 0
D 10 0 4 1-Aug 0
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
your data as I visualise is like this

Excel Workbook
ABCDEFGHI
1Salesperson1-Aug2-Aug3-Aug4-Aug5-Aug6-AugLaunchDateResult
2A010050123-Aug2
3B02002-Aug1
4C405004-Aug0
5D10041-Aug0
Sheet1


SALESLPERSON A
laluch date 3 aug. 4 aug and 6 aug are non blanks so result 2 ok

B
launch date 2 aug. there are no non blanks after 2 aug so it should be 0 how is it 1

C launch date 4 aug. there are no non blanks after 4 aug so 0 ok

D launch data 1 aug. 3 aug is non blank so it sholud be 1 how is it 0.

please explain.logic
 
Upvote 0
Thanks a lot venkat for your interest I'm helping me out.
I need to count the non blanks cells which include the zero values since it counts the sales person's visit after the first launch be the repeat sales happen or not.
 
Upvote 0
still confusion in my mind
salesman A

launch date 3 aug.


4th aug is 5
5th aug 0
6th aug 12

then it should be 3 not 2

explain with this and also each salesman as given by me above
 
Upvote 0
still confusion in my mind
salesman A

launch date 3 aug.


4th aug is 5
5th aug 0
6th aug 12

then it should be 3 not 2

explain with this and also each salesman as given by me above

For salesperson A launch date is 3-Aug however his launch sales happen on 4-Aug with sales of 5 units after the launch he visited the outlet on 5-Aug with no sale and his second visit was on 6-Aug with sale of 12 units, thus "after launch" his total visits are 2 only
I the above table the result for salesperson D is wrong it should be 2, apologies for the same.
Cheers!
 
Last edited:
Upvote 0
"For salesperson A launch date is 3-Aug however his launch sales happen on 4-Aug with sales of 5 units after the launch he visited the outlet on 5-Aug with no sale and his second visit was on 6-Aug with sale of 12 units, thus "after launch" his total visits are 2 only"

still confused.
according to above quote the number you require is
NUMBER OF SUCCESSFUL VISITS from the next day to launch date

that is why

salesperson A
launch date 3 aug
from 4 th to 6 successful visits are only 2 that is 4th and 6th ok
salesperson B
launch date 2 aug
between 3 aug and 6 aug no successful visit so it must be 0
salesperson C
launch date 4th aug
between 5th and 6th aug no successful visit so must be 0
salesperson D
launch date 1 august
between 2 and 6th aug there are only one successful visit that is 3 aug so it must be 1

on the other hand criterion is no. of visits with successful and unsuccessful visits then
sales person A 4th,5th 6th so must be 3
sales person B 3 aug so must be 2
sales person C 5th aug so must be 1
sales person D 2nd and 3rd so 2

your comments please. my macro is almost ready only needs tweaking on the basis of your comments.
 
Upvote 0
Hi Venkat

Though the launch dates are officially decided but the actual launch will happen with >0 value date which falls after the official launch date.
After that successful launch i.e. >0 value I need to count all the successful (>0) and unsuccessful (=0) visit.

Salesperson A: Official launch date is 3-Aug, actual launch happen on 4-Aug, after that launch he visits the outlet on 5th unsuccessful and on 6th successful so it is 2.

Salesperson B:Official launch date is 2-Aug, actual launch happen on 2-Aug, after that launch he visits the outlet on 3-Aug unsuccessful so it is 1.

Salesperson C:Official launch date is 4-Aug, actual launch did not happen (no >0 value after 4-Aug so it is 0.

Salesperson D:Official launch date is 1-Aug, actual launch happen on 1-Aug, after that launch he visits the outlet on 2-Aug unsuccessful and 3-Aug successful so it is 2.(I had made an error in calculating this Salesperson D, apoligies for it)
 
Upvote 0
now understood. but see saleslperson D
launch date 1 aug
effective launch date first non zero visit after 1st aug that is 3 aug.
no other visits after 3 aug
so it must be 1 not 2
reconsider.

LANGUAGE IS A POOR TOOL OF COMMUNICATION.WHEN PERSONS ARE NOT FACE TO FACE.
 
Upvote 0
Salesperson D: After launch on 1-Aug his first visit was on 2-Aug(unsuccessful) denoted as '0' , his second visit was on 3-Aug (successful) thus it is 2.
 
Upvote 0
sorry again

"the actual launch will happen with >0 value date which falls after the official launch date."

that is actual launch date is the first SUCCESSFUL date

but now yous say

"After launch on 1-Aug his first visit was on 2-Aug(unsuccessful) denoted as '0' , his second visit was on 3-Aug"

that means unsuccessful date is taken as the actual date
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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