Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-02-2012, 12:29 AM
ibrahimaa ibrahimaa is offline Vlookup Windows Vista Vlookup Office 2007
Advanced Beginner
Vlookup
 
Join Date: May 2011
Posts: 35
ibrahimaa is on a distinguished road
Default Vlookup


In the attached file, I am using VLOOKUP in sheet 1 to extract the number of employees belong to each division.

Medical Division was in Department 1 then was transferred to Dept 3 then to Dept 4. I want to add its 3 numbers (500 + 450 + 470)
To calculate the average and the maximum number (500).

The problem is that VLOOKUP read the 1st record only.
I appreciate your help.
Attached Files
File Type: xlsx Test1.xlsx (9.9 KB, 18 views)
Reply With Quote
  #2  
Old 03-02-2012, 02:31 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Vlookup Windows XP Vlookup Office 2003
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,767
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Perhaps
Code:
=SUMPRODUCT(--(B2:B20="medical")*C2:C20)
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 03-02-2012, 11:47 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Vlookup Windows 7 32bit Vlookup Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

SUMIF() should do the trick quite nicely.


=SUMIF(B2:B20,"Medical",C2:C20)
__________________
Colin

RAD Excel Blog
Reply With Quote
  #4  
Old 03-03-2012, 12:26 AM
ibrahimaa ibrahimaa is offline Vlookup Windows Vista Vlookup Office 2007
Advanced Beginner
Vlookup
 
Join Date: May 2011
Posts: 35
ibrahimaa is on a distinguished road
Default Vlookup

Thanks a lot Colin Legg and Pecoflyer for your great support. I have tried the 2 functions plus subtotal & Sumifs and try to merge with MAX function to get the highest number of employees in each division but without success.

My problem is that I found that some of these divisions were repeated 2 times and 4-5 times in other times because of the organization historical reconstructions. Any additional support will be appreciated. Thank you.
Reply With Quote
  #5  
Old 03-03-2012, 01:58 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Vlookup Windows 7 32bit Vlookup Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Sorry, I missed that you want the average and max as well.

Sum
=SUMIF(B2:B20,"Medical",C2:C20)

Average
=AVERAGEIF(B2:B20,"Medical",C2:C20)

Max (this is an array formula, CTRL+SHIFT+ENTER, not just ENTER)
=MAX(IF(B2:B20="Medical",C2:C20))

However, if you want to repeat this exercise for each division then you should use a pivot table. I have attached an example.
Attached Files
File Type: xlsx Test1.xlsx (14.1 KB, 9 views)
__________________
Colin

RAD Excel Blog
Reply With Quote
  #6  
Old 03-04-2012, 11:24 AM
ibrahimaa ibrahimaa is offline Vlookup Windows Vista Vlookup Office 2007
Advanced Beginner
Vlookup
 
Join Date: May 2011
Posts: 35
ibrahimaa is on a distinguished road
Default Vlookup

Colin Legg and Pecoflyer,

I do really appreciate your great support.
My actual situation was complicated where I received from personal Dept 20,000 records represent 2000 Depts & divisions with their manpower 7 years history.

However, I have just succeeded after 5-7 hours of working and I would never do it without your support.

Once more, thank you very much and let me know if you have complicated issues so I can solve it for you .
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Vlookup & IF together thelauncher Excel 5 08-25-2013 11:32 PM
Vlookup ibrahimaa Excel 8 01-03-2012 09:32 PM
Vlookup Can i do this with a VLookup? foodstudent Excel 1 01-21-2011 12:34 AM
Using IF & VLOOKUP together junction Excel 7 11-18-2010 05:15 AM
Help with VLOOKUP sakhtar Excel 2 07-24-2010 07:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft