How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask John D Your Own Question

John D
John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9654
Experience:  Bachelor of Science - Engineering Consultant
Type Your Microsoft Office Question Here...
John D is online now
A new question is answered every 9 seconds

In MS Excel, is there a way to count the number of times a

Customer Question

In MS Excel, is there a way to count the number of times a particular value occurs in each cell of a given array of cells which is updated through a number of iterations?

I have a macro that runs a given scenario a number of times with a volatility variable which causes each cell in the given array to either register a zero or a one for each iteration of this scenario and I want to count the number of times a one occurs in each cell of that array.

Each iteration of the macro will write over the previous iteration value in each cell of the referenced array.

Thanks!

Don
Submitted: 1 year ago.
Category: Microsoft Office
Expert:  Steve Herrod replied 1 year ago.

Steve Herrod :

Hi Don,


 

Steve Herrod :

I'll be happy to help with this issue


 

Steve Herrod :

would you be able to upload the file at all as that may be easiest to work from?


 

Steve Herrod :

if you go to wikisend.com and choose upload


 

Steve Herrod :

you can upload the file and it will give you a link I can use to access


 

Steve Herrod :

Cheers


 

Steve Herrod :

Steve


 

Customer :

Hi Steve...I uploaded the file on Wikisend, after cleaning-up confidential information. The file number is XXXXX


 


Open the file to the "Main" sheet. "Hit" the keys "Cntrl" and "X" to initiate the macro. For every iteration of the macro, the array of cells at the bottom of the sheet will update with a 1 or a 0. I would like to accumulate the total number of 1's for each cell in the array from the start of the macro through its completion.


 


...make any sense?


 


Thanks!


 


Don

Steve Herrod :

thanks - checking that now!


 

Steve Herrod :

cheers


 

Steve Herrod :

Steve


 

Steve Herrod :

Hi Don,


 

Steve Herrod :

 


 

Steve Herrod :

Have been looking through various options to get this working but haven't been able to and will be away from laptop over next day or so on a project so I will open this to other experts in the meantime


 

Steve Herrod :

they will be able to see the details and the file link as well


 

Steve Herrod :

if no-one has responded I'll pick this up when back online properly late Thursday/Friday


 

Steve Herrod :

Cheers


 

Steve Herrod :

Steve


 

Customer :

Okay...Thanks!


 


Don

Expert:  Rachel-Mod replied 1 year ago.

Hi, I’m a moderator for this topic. It seems the professional has left this conversation. This happens occasionally, and it's usually because the professional thinks that someone else might be a better match for your question. I've been working hard to find a new professional to assist you right away, but sometimes finding the right professional can take a little longer than expected.

I wonder whether you're OK with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, feel free to let me know and I will cancel this question for you. Thank you!

Customer: replied 1 year ago.


...not a problem.


 


Thanks!


 


Don

Expert:  Rachel-Mod replied 1 year ago.

Thank you for your continued patience. We will continue the search for a Professional for you.

Expert:  Yegarboy replied 1 year ago.
Hey there,

How many individual cells do you want to count the 1's and 0's?

Where do you want to store the results of the 1's and 0's?

I see when the Calc Macro runs, it selects a range of cells at a time. Is that to be taken into consideration as well?
Customer: replied 1 year ago.


There are 43 cells at the bottom of the Main sheet (highlighted in red), for which I want to count the total number of 1's that occur in each of these cells, from the start of the macro through the end.


 


It really doesn't matter where these totals are stored, but anywhere below the 43 cells at the bottom should be fine.


 


The macros should not be a factor in determining the count of the 43 cells, though I am looking for a way to count the total the number of times each cell of the 43 cells has a value of 1, from the start of the macro through the end.


 


Thanks!


 


Don

Expert:  Lindie-mod replied 1 year ago.
Thank you for your patience, your business is very important to us, we are waiting on the Professional with the right expertise to come online. Feel free to let us know if you would like us to continue searching for a Professional or if you would like us to close your question. Thank you for your understanding!
Customer: replied 1 year ago.


...any word on this yet?

Expert:  JACUSTOMER-83mccr04- replied 1 year ago.
Hello my name is XXXXX XXXXX X will gladly try to assist you with your question.

It sounds as if your needing to use the COUNTIF Function which will count a particular variable that you choose.

Here is an example:

=COUNTIF(A1:A43,0)

=COUNTIF(A1:A43,1)

The first countif will result in the number of times a 0 is within that range and the second one will result in the number of times a 1 is within that range.

Obviously, the only thing you will need to edit in that function is the cell range since I do not know exactly what range your data is in.

Please let me know if you have any questions
Customer: replied 1 year ago.


This will give me the count of a single iteration, but I'm looking for a way to accumulate these counts, for each cell in the array of cells, over 800 iterations. After each iteration this array of cells gets written over by the next iteration...the crux of the problem.


 


Thanks.


 


Don

Expert:  JACUSTOMER-83mccr04- replied 1 year ago.
I understand. That can be accomplished writing VBA code into the workbook. I will opt out for a VBA coding expert to assist you. This question may be better suited in the Programming category.
Expert:  Rachel-Mod replied 1 year ago.

Hi, I’m a moderator for this topic. It seems the professional has left this conversation. This happens occasionally, and it's usually because the professional thinks that someone else might be a better match for your question. I've been working hard to find a new professional to assist you right away, but sometimes finding the right professional can take a little longer than expected.

I wonder whether you're OK with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, feel free to let me know and I will cancel this question for you. Thank you!

Customer: replied 1 year ago.

...no problem. Thanks!

Expert:  Rachel-Mod replied 1 year ago.
Hello Don,

I will continue to search for another Professional for you. Thank you for your continued patience

Rachel ~ Moderator
Expert:  John D replied 1 year ago.
Hi,

I will try to help you with this but I need you to upload the file again (the one that you have uploaded last week has expired)

Thank you
Customer: replied 1 year ago.


...no problem. Use 149496 to upload.

Expert:  John D replied 1 year ago.
Got it, thanks

Ok which macro is the one in question, and how is it triggered (by which button and from which sheet)
Customer: replied 1 year ago.

MultFCalcs is triggered by "CNTL X" and runs a subroutine called FCalcs which does 100 iterations of calculations. The subroutine is called 8 times for a total of 800 iterations.


The other subroutines are for protecting and unprotecting the spreadsheets and are unrelated.

Customer: replied 1 year ago.

MultFCalcs is triggered by "CNTL X" and runs a subroutine called FCalcs which does 100 iterations of calculations. The subroutine is called 8 times for a total of 800 iterations.


The other subroutines are for protecting and unprotecting the spreadsheets and are unrelated.


 


The macro is run from the "Main" sheet

Expert:  John D replied 1 year ago.
That is a lot of code to go through!

Which iteration do you want to keep track of and where do you need the number of iterations to be displayed
Customer: replied 1 year ago.

After each iteration of FCalcs, I would like to keep a running total of 1's in each of the cells in the array of cells (highlighted in red) at the bottom of the Main sheet.


 


MultFCalcs should initialize this array of cells (to 0's) and the summation in each of the cells should continue throug the end of MultFCalcs and the total count for each cell should be displayed either in the same array or in a new array of cells just below.


 


Thanks!


 


Don

Expert:  John D replied 1 year ago.

Don,

 

I have been working on this for some time now and have created routines to count the number of times during the execution of the macro when each of the red cells changes to 1 or 0 but the FCalcs macro does not seem to have any effect on these red cells (the cell values are not changing to 1's and 0's and hence there is nothing that gets counted)

At this point I think I will opt out as I can invest more of my time on this just trying to understand the problem

 

 

 

 

Customer: replied 1 year ago.

The 1's will tend to appear more toward the right end of the array of cells. They tend to remain at 0's or unchanges at the left end of the array.

Expert:  Rachel-Mod replied 1 year ago.
Hello Don,

Hi, I’m a moderator for this topic. It seems the professional has left this conversation. This happens occasionally, and it's usually because the professional thinks that someone else might be a better match for your question. I've been working hard to find a new professional to assist you right away, but sometimes finding the right professional can take a little longer than expected.

I wonder whether you're OK with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, feel free to let me know and I will cancel this question for you. Thank you!

Rachel ~ Moderator


Customer: replied 1 year ago.


...no problem.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
< Last | Next >
  • http://ww2.justanswer.com/uploads/JS/jstinehelfer/2012-6-6_215146_Pictureofme1.64x64.png jstinehelfer's Avatar

    jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
  • http://ww2.justanswer.com/uploads/JA/JasonJames122/2011-12-16_135647_jasonjamesheadshotweb.64x64.jpg JasonJames122's Avatar

    JasonJames122

    Computer Enthusiast

    Satisfied Customers:

    0
    I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business
  • http://ww2.justanswer.com/uploads/JE/jessmagz/2012-6-6_18129_jm.64x64.jpg Jess M.'s Avatar

    Jess M.

    Computer Support Specialist

    Satisfied Customers:

    301
    Computer Software Specialist for more than 10 years
  • http://ww2.justanswer.com/uploads/CH/chutz747/2011-11-6_14231_me.64x64.jpg The-PC-Guy's Avatar

    The-PC-Guy

    Computer Manager

    Satisfied Customers:

    274
    20 years experience providing remote computer support
  • http://ww2.justanswer.com/uploads/SP/spherrod/2012-6-6_174244_1000852.64x64.JPG Steve Herrod's Avatar

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    125
    Trained in Microsoft Office from 2000 through to latest version 2010.
  • http://ww2.justanswer.com/uploads/SE/Seashore2011/2011-12-6_33418_111205223015.64x64.jpg Chris L.'s Avatar

    Chris L.

    Support Specialist

    Satisfied Customers:

    124
    Certified Expert with over 10 years experience.
  • http://ww2.justanswer.com/uploads/KR/krkljatorm/2012-6-24_153417_ITMiro.64x64.jpg IT Miro's Avatar

    IT Miro

    Computer Scientist

    Satisfied Customers:

    97
    Bachelor's Degree in Information Technology, Microsoft Certified Professional