help with macro, I need the macro to add a range depending on several criteria
Attached file for better understanding
help with macro, I need the macro to add a range depending on several criteria
Attached file for better understanding
Can you give more details:
What is the range and where
What are the criterias
- Battle without fear gives no glory - Just try
For example 1 of attachment
the ranges are the columns identified as ID and the values to add are from columns Q to V and the criteria are columns N and P
attached image
Screenshot_65.png
thanks for answering
and for example 2 of the attached file, add column D to the same records in column A, B and C, the result in column E and F
Screenshot_66.png
Could we say it is for sheet "EJEMPLO1" ??
Can you give an example with numerical data: Which values is used to give which result ???
Last edited by PCI; 08-21-2018 at 08:06 AM.
Good day, thanks for answering.
What I want is the following:
if in column A there are two or more equal records and in column B and C their criteria are equal, total the value of column D
Origin sheet
A B C D
1 123 51 10 600
2 123 51 10 400
3 888 52 20 300
Destiny sheet
A B C D
1 123 51 10 1000
2 888 52 20 300
I hope that with this example, greater understanding
I'm sorry attach the file that was not.
As you will see, the result only takes into account column A and not B and C
Let's come back to your last example and last file.
For ID EP = 123 EP = 1300
Why, when in sheet "ORIGEN" for ID EP = 123 criteria are not the same
Should give 600 + 400 as result for ID EP = 123if in column A there are two or more equal records and in column B and C their criteria are equal, total the value of column D
And should exist as result
123 52 20 300
Please explain !!!
Last edited by PCI; 08-21-2018 at 05:07 PM.
is correct for the last example the macro works partially, since it totals based on the ID EP and is not taking into account By D
Screenshot_29.png
That would be the desired result. For which I ask for your help
OKAY try next code
Please Login or Register to view this content.
works perfect, is what I needed
Could I ask you for another favor, to add another parameter?
With the previous example, do the same considering the date. That is to say that totals taking into account period (date).
Screenshot_32.png
de esta manera
Do you mean?
Please Login or Register to view this content.
the code does not work
when using the code, the results are located and operate differently, as the image shows
Screenshot_70.png
I attach the file with the supplied code
My code was for your workbook uploaded one before with the date in col.A.
For the one you just uploaded.
Please Login or Register to view this content.
ok, sorry
I already try it with that example, thank you very much
Screenshot_72.png
is adding the column of E and does not show result in column F where the totals should go.
but before continuing, I see that the order of the date and registration column is wrong
Column A = Reg and B = date
Screenshot_73.png
It is working for me
If I see that it works, maybe something went wrong.
Regarding the last request to change the order, could you help me please?
Column A = Reg and B = date
Try change to
Please Login or Register to view this content.
Thank you very much for your help, your collaboration has been very valuable.
do the same considering the date. That is to say that totals taking into account period (date).
Please give more details:
Do we need to care about the date as just data to report or use the date as criteria
For example
in case
DATE ID EP GRUPO CENTRO COSTO EP
30/07/2018 123 51 10 600
30/08/2018 123 51 10 400
What will be the result shown ???
good day, thanks for answering
the result was like the one in the picture
Screenshot_74.png
REG FECHA ID EP GRUPO CENTRO COSTO EP
1 30/07/2018 123 51 10 600
2 30/08/2018 123 51 10 400
See next code
Please Login or Register to view this content.
The code works but does not separate the total x month
Screenshot_35.png
Regarding the last request to change the order, could you help me please?
Column A = Reg and B = date
See here
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks