ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Function help! (https://www.excelbanter.com/excel-discussion-misc-queries/92122-function-help.html)

phil2006

Function help!
 

What function would I need to use to update from my second sheet to my
first using macros? I am creating a sheet based on countries so when
the Ukraine, for example, is the country in question I need to add
their corresponding value and when the country is Canada I need to add
theirs etc. I have been attempting using the 'if' function but this
does not work and doesn't include enough potential country names.
Ideally I need a function that shall allow me to add each countries'
individual corresponding value.
Thanks for your help.


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=548521


Roger Govier

Function help!
 
Hi Phil

On your second sheet create a list of all of your countries in column A,
and the values you want associated with them in column B.
On sheet 1, with the country name entered in A1 use the following
formula in B1
=VLOOKUP($A1,Sheet2!$A$1:$B$100,2,0)
Change the range on Sheet2 from A1:B100 to include all of the data you
have set up on Sheet2.

If there is more than one value you want to retrieve for each country,
then include this data in column C, D etc. and alter the range to
A1:D100 for example.
Change the formula to
=VLOOKUP($A1,Sheet2!$A$1:$D$100,COLUMN(1:1),0)
then drag the formula across into cells C1 and D1 on Sheet1.

--
Regards

Roger Govier


"phil2006" wrote
in message ...

What function would I need to use to update from my second sheet to my
first using macros? I am creating a sheet based on countries so when
the Ukraine, for example, is the country in question I need to add
their corresponding value and when the country is Canada I need to add
theirs etc. I have been attempting using the 'if' function but this
does not work and doesn't include enough potential country names.
Ideally I need a function that shall allow me to add each countries'
individual corresponding value.
Thanks for your help.


--
phil2006
------------------------------------------------------------------------
phil2006's Profile:
http://www.excelforum.com/member.php...o&userid=35092
View this thread:
http://www.excelforum.com/showthread...hreadid=548521




phil2006

Function help!
 

Thanks very much, I feel like I'm getting there a bit but it's still not
working. My second page list is long and countries appear numerous times
in the column. I need to find a way of adding their totals each time
onto the first page and each new value shall displace the old one using
the macros.
Is there a function that could do this?

Thanks again


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=548521



All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com