Hey Dear community,
I use this code
But instead of "MARKET" i need to use range from sheet2 A2:A35 how can i do that?Please Login or Register to view this content.
Hey Dear community,
I use this code
But instead of "MARKET" i need to use range from sheet2 A2:A35 how can i do that?Please Login or Register to view this content.
Last edited by jeffreybrown; 12-09-2018 at 10:45 AM. Reason: Please use code tags!
Try this code
Please Login or Register to view this content.
< ----- Please click the little star * next to add reputation if my post helps you
Visit Forum : From Here
Thanks for reply but i get error Type mismatch
Change "Sheet2" to the name of your sheet
or if its index Sheet2 use
Please Login or Register to view this content.
i still get same error / I changed sheet2 to "Markets"
Please Login or Register to view this content.
Last edited by jeffreybrown; 12-09-2018 at 10:44 AM. Reason: Please use code tags!
I think you should use
Sheets("Markets") instead of just Markets
And it is better to upload sample of your file if you still have a problem
Still not working :/
Upload sample of your workbook with some of the desired output
i have uploaded it from " Manage attachment "
What's your criteria for SUMIF?
Try this ..
Please Login or Register to view this content.
Criteria is A2:A35 in sheet2
not working
Last edited by Akbarov; 11-29-2018 at 02:16 AM.
Please Login or Register to view this content.
Thank you very much works.
But can you explain me? because i need to do same think for B2:B111 too
Change last line to
So you will see how it calculates.Please Login or Register to view this content.
SumIf does not work like this.
Sorry i am new in VBA, is there any easy way you explain me? how can i put B2:B111 instead of A2:A35?
Do you mean
Instead ofPlease Login or Register to view this content.
?Please Login or Register to view this content.
thank you very much! if possible last question. how can i put to criteria? if match A2:A35 and "M"
Sorry, but I don't understand what you are trying to say.
If you upload a workbook with your result, it may help...
I mean 2 criteria. If Market name match B2:B111 and H:H match "M"
This is more like a Formula question....
Please Login or Register to view this content.
Mr. jindon can you please tell me how can i add 1 more criteria to your formula? if E:E ">0" ?
You need to understand the formula
Now, enter following formula in any cell and confirm with Ctrl + Shift + Enter(Array formula entry)
=sum(if((isnumber(match(myrg1,market,0)))*(myrg3="M"),myrg2))
As you see myrg1,market, myrg3 and myrg2 are all named range.
If you wan to add more condition, 1st create a named range in ColE ("ColE" for example) that has same size of myrg1 and join with *(condition)
and see if the formula returns correct value
=sum(if((isnumber(match(myrg1,market,0)))*(myrg3="M")*(cole>0),myrg2))
otherwise, every time you need to change it , you need to ask.
shuld i change MyRG each time from name manager? for example MyRg1 refers to O:O on second code it refers to D:D i use same code for 12 results, i change refer adress from VBA code
Last edited by Akbarov; 12-09-2018 at 09:52 AM.
What are you really trying to do?
I just used these named range as your original code has them already, though I don't normally use named range.
If you want that calculation in multiple cells with different column reference, you need to show us in the workbook clearly showing how it should be calculated.
Otherwise, as I mentioned already, this is rather a forumla question, so better ask in FORMULA section.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks