Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Chaandni
 
Posts: n/a
Default How can I use the vlookup function to return a sum of the values?

Hi,

I am trying to use the vlookup function to return several values as 1 result
into 1 single cell. For example, i have a spreadsheet which lists several
different dpeartments. These departments may be repaeted many times in the
spreadsheet. I need a sum of thoses values to be returned in a separate cell
using the vlookup function. Can someone help me on this please?

Thanks
  #2   Report Post  
Paul Sheppard
 
Posts: n/a
Default How can I use the vlookup function to return a sum of the values?


Chaandni Wrote:
Hi,

I am trying to use the vlookup function to return several values as 1
result
into 1 single cell. For example, i have a spreadsheet which lists
several
different dpeartments. These departments may be repaeted many times in
the
spreadsheet. I need a sum of thoses values to be returned in a separate
cell
using the vlookup function. Can someone help me on this please?

Thanks


Hi Chaandni

Try This

=SUM(COUNTIF(A1:A12,"dept a")+COUNTIF(A1:A12,"dept b"))

Change the range (A1:A12) to suit your data, add as many dept's to the
formula as required


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=482782

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default How can I use the vlookup function to return a sum of the values?

SUM and + are replicating each, you don't need both.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul Sheppard"
wrote in message
news:Paul.Sheppard.1y4oam_1131369001.7675@excelfor um-nospam.com...

Chaandni Wrote:
Hi,

I am trying to use the vlookup function to return several values as 1
result
into 1 single cell. For example, i have a spreadsheet which lists
several
different dpeartments. These departments may be repaeted many times in
the
spreadsheet. I need a sum of thoses values to be returned in a separate
cell
using the vlookup function. Can someone help me on this please?

Thanks


Hi Chaandni

Try This

=SUM(COUNTIF(A1:A12,"dept a")+COUNTIF(A1:A12,"dept b"))

Change the range (A1:A12) to suit your data, add as many dept's to the
formula as required


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile:

http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=482782



  #4   Report Post  
Chaandni
 
Posts: n/a
Default How can I use the vlookup function to return a sum of the valu

Thanks for your message Paul but unfortunatley it does not give the required
soiltion. Maybe if I give you extra detail it may help to resolve the issue.

As an example, say if I want to look up a department X2 in a spreadsheet as
follows and retrun the sum of its head count value as follows:

DEPARTMENT HEAD COUNT
X2 1
X3 05
X2 0.5
X2 1
D4 1
D4 1

As you can see from the example, department x2 appears several times because
it is unique to an employee. I want to return a sum of the headcount in
department X2 eg. 2.5 in a single cell. Currently, when i use the vlookup
function, it returns only the first value eg. 1. How can I use the vlookup
function or any other function so that a sum is returned?

Your help will be greatly appreciated!

Thanks

Chaandni



"Paul Sheppard" wrote:


Chaandni Wrote:
Hi,

I am trying to use the vlookup function to return several values as 1
result
into 1 single cell. For example, i have a spreadsheet which lists
several
different dpeartments. These departments may be repaeted many times in
the
spreadsheet. I need a sum of thoses values to be returned in a separate
cell
using the vlookup function. Can someone help me on this please?

Thanks


Hi Chaandni

Try This

=SUM(COUNTIF(A1:A12,"dept a")+COUNTIF(A1:A12,"dept b"))

Change the range (A1:A12) to suit your data, add as many dept's to the
formula as required


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=482782


  #5   Report Post  
RagDyeR
 
Posts: n/a
Default How can I use the vlookup function to return a sum of the valu

Try this:

=SUMIF(A1:A20,"X2",B1:B20)

You can also reference a cell to contain the dept. you're looking to total,
so that you don't have to change the formula itself to change the dept.:

=SUMIF(A1:A20,C1,B1:B20)
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Chaandni" wrote in message
...
Thanks for your message Paul but unfortunatley it does not give the required
soiltion. Maybe if I give you extra detail it may help to resolve the issue.

As an example, say if I want to look up a department X2 in a spreadsheet as
follows and retrun the sum of its head count value as follows:

DEPARTMENT HEAD COUNT
X2 1
X3 05
X2 0.5
X2 1
D4 1
D4 1

As you can see from the example, department x2 appears several times because
it is unique to an employee. I want to return a sum of the headcount in
department X2 eg. 2.5 in a single cell. Currently, when i use the vlookup
function, it returns only the first value eg. 1. How can I use the vlookup
function or any other function so that a sum is returned?

Your help will be greatly appreciated!

Thanks

Chaandni



"Paul Sheppard" wrote:


Chaandni Wrote:
Hi,

I am trying to use the vlookup function to return several values as 1
result
into 1 single cell. For example, i have a spreadsheet which lists
several
different dpeartments. These departments may be repaeted many times in
the
spreadsheet. I need a sum of thoses values to be returned in a separate
cell
using the vlookup function. Can someone help me on this please?

Thanks


Hi Chaandni

Try This

=SUM(COUNTIF(A1:A12,"dept a")+COUNTIF(A1:A12,"dept b"))

Change the range (A1:A12) to suit your data, add as many dept's to the
formula as required


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile:

http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=482782






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Match function with duplicate values in an array Richard Excel Worksheet Functions 3 April 22nd 23 07:45 PM
Return Range of Numerical Values in Single Column based on Frequency Percentage Sam via OfficeKB.com Excel Worksheet Functions 9 October 28th 05 11:01 PM
How do I access data stored in a SQL server for vlookup function? M.Heer Excel Worksheet Functions 8 May 12th 05 09:51 PM
VLOOKUP Function Neoseraph Excel Worksheet Functions 12 April 4th 05 12:21 AM
Return value with using Excel function SNOWBALLCHAN New Users to Excel 1 February 21st 05 07:25 AM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"