Hi guys,
I have a question. I want to select all "id"s from column A that has all three results next to it in column B e.g. breakfast, lunch, supper. and count them in cell C2. Thanks in advance!
Hi guys,
I have a question. I want to select all "id"s from column A that has all three results next to it in column B e.g. breakfast, lunch, supper. and count them in cell C2. Thanks in advance!
Hi batya,
try this
Please Login or Register to view this content.
This seems to be working on this simplified table.Can you help with this code on this attachment. But this time it is "id" from column B and results from column H and count them in cell P2. Thanks again!
try it
Please Login or Register to view this content.
It is working but when i execute the code it also counted 'id'=89 also but it has not got all three results e.g ertirlik, oylan nahar, agsam nahar next to it (from column H). instead it has two ertirlik and 1 agsam nahar. does it count only matching "id"s and give result or counts using conditions i gave above? Thanks
then try this
Please Login or Register to view this content.
you are amazing. can you help me with highlighting the "id"s like it was in previous version (i can't check the results) . Also if you have time. Is it possible to count separately these variables e.g ertirlik, oylan nahar, agsam nahar and write result in cell P3, P4 and P5. Thanks a lot
Try
Please Login or Register to view this content.
it does not work as intended it should give separate counts of these variables "ertirlik", "oylan nahar", "agsam nahar" in cells P3, P4 and P5. manually counted result should be as this: 52,130,84
Are they just count each meal?
Total are the rows that have 3 meals together.Please Login or Register to view this content.
Last edited by jindon; 06-18-2019 at 04:55 AM.
yes kind sir. the 3 three counts for meals are correct but as for a counting the "id"s that have three (ertirlik, oylan nahar, agsam nahar) result next to it in column H, it gives result 87. which is correct if it counts all highlighted cells. 87/3=29 but it should be 28. i think it is because some "id"s have double "ertirlik"s. the one that user "nilem" wrote gave me the correct result. can u combine his code (including the function to "highlight IDs") and yours which counts meals separately? thanks in advance!
Is this how you wanted?
Please Login or Register to view this content.
i'm sorry Mr. Jindon i think your first reply is exactly what i want. and everything seems to work fine. Thanks again guys for your time. You guys are best. I hope i didn't take much of your time.
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
One last question. I've protected the worksheet with password but VBA code won't execute if it is protected. what can i do about it? is it possible to add somewhere in below code so that it unprotect it in the beginning and protects again at the end!
Please Login or Register to view this content.
Add 2 lines in bold
change "Password" to actual one or just delete it if no password used.Please Login or Register to view this content.
i tried it still gives me error 1004. when i debug it highlights this areaPlease Login or Register to view this content.
Last edited by batya; 06-18-2019 at 07:27 AM.
OOps... of course..
Please Login or Register to view this content.
now it works. thanks for your time.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks