![]() |
Lookup arrayvalue in list
Hi, I have tried to look around on the net for this question, but i found no solutions straight away, so i figured i would ask the clever people here! I have two arrays C(j) and CP(i,j), in which country codes are stored in the first, and the corresponding values for the sector(i) and country(j) is stored in the second. I.e. sector i and country j would return example: "Some sector", C(j)= "USA",CI(i,j)= 13 % . Now i would like to match C(j) with a list stored in another array or a named range in a spreadsheet and if the country is part of the subregion, the percentage should sum into a variable Subregion1 f.x. I was thinking of using index(match), but i am not sure how. F.x somthing like: For i = 1 to NumberofSectors For j = 1 to NumberofCountries IF Index(match.....C(j).......Subregion)) = True' I dont know index formula sumsubregion = sumsubregion + CI(i,j) End IF Next i Will this work and can i use the index function? Thank you in advance! -- erikhs ------------------------------------------------------------------------ erikhs's Profile: http://www.excelforum.com/member.php...o&userid=32788 View this thread: http://www.excelforum.com/showthread...hreadid=565958 |
All times are GMT +1. The time now is 03:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com