#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Vlookup issues

Hello all,

I current have a spreadsheet that does a vlookup from a table that
contains the following:

VD Vacation Day 1
PD Personal Day 1
VH Half Day Vacation Day 0.5
PH Half Day Personal Day 0.5
HO Home Office 0
AS Assignment 0

I have worksheets for every month that that has the days of the month
vertically. The user will enter one of the codes in the table
according to the type of day taken.

I have a vlookup on a totals sheet:

=VLOOKUP(January2008!C5,Codes,3,FALSE)

This works fine and gives me 1 for the output when VD is entered.

Now the issue, I want to total a row based on the value in the table,
that is if the codes for three seperate dates are, PD, PH, VD the
total should be 2.5

I tried:

=VLOOKUP(January2008!C5:AB5,Codes,3,FALSE)

but it errors out, I know I can do =VLOOKUP(January2008!C5,Codes,
3,FALSE) +VLOOKUP(January2008!D5,Codes,3,FALSE)+.......

but that would take be a huge formula.

Is there a way I can sum up the vlookup without a huge formula.

Thanks to all.

Michael Hager
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Vlookup issues

Michael,

Try

=COUNTIF(January2008!C5:AB5,"VD") +
COUNTIF(January2008!C5:AB5,"PD") +
COUNTIF(January2008!C5:AB5,"VH")/2 +
COUNTIF(January2008!C5:AB5,"PH")/2

If you want to keep it flexible, then use this:

=COUNTIF(January2008!C5:AB5,"VD")*VLOOKUP("VD",Cod es,3,False)+
COUNTIF(January2008!C5:AB5,"PD")*VLOOKUP("PD",Code s,3,False) +
COUNTIF(January2008!C5:AB5,"VH")*VLOOKUP("VH",Code s,3,False) +
COUNTIF(January2008!C5:AB5,"PH")*VLOOKUP("PH",Code s,3,False)

--
HTH,
Bernie
MS Excel MVP


wrote in message
...
Hello all,

I current have a spreadsheet that does a vlookup from a table that
contains the following:

VD Vacation Day 1
PD Personal Day 1
VH Half Day Vacation Day 0.5
PH Half Day Personal Day 0.5
HO Home Office 0
AS Assignment 0

I have worksheets for every month that that has the days of the month
vertically. The user will enter one of the codes in the table
according to the type of day taken.

I have a vlookup on a totals sheet:

=VLOOKUP(January2008!C5,Codes,3,FALSE)

This works fine and gives me 1 for the output when VD is entered.

Now the issue, I want to total a row based on the value in the table,
that is if the codes for three seperate dates are, PD, PH, VD the
total should be 2.5

I tried:

=VLOOKUP(January2008!C5:AB5,Codes,3,FALSE)

but it errors out, I know I can do =VLOOKUP(January2008!C5,Codes,
3,FALSE) +VLOOKUP(January2008!D5,Codes,3,FALSE)+.......

but that would take be a huge formula.

Is there a way I can sum up the vlookup without a huge formula.

Thanks to all.

Michael Hager



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Vlookup issues

On Jan 15, 12:19 pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Michael,

Try

=COUNTIF(January2008!C5:AB5,"VD") +
COUNTIF(January2008!C5:AB5,"PD") +
COUNTIF(January2008!C5:AB5,"VH")/2 +
COUNTIF(January2008!C5:AB5,"PH")/2

If you want to keep it flexible, then use this:

=COUNTIF(January2008!C5:AB5,"VD")*VLOOKUP("VD",Cod es,3,False)+
COUNTIF(January2008!C5:AB5,"PD")*VLOOKUP("PD",Code s,3,False) +
COUNTIF(January2008!C5:AB5,"VH")*VLOOKUP("VH",Code s,3,False) +
COUNTIF(January2008!C5:AB5,"PH")*VLOOKUP("PH",Code s,3,False)

--
HTH,
Bernie
MS Excel MVP

wrote in message

...

Hello all,


I current have a spreadsheet that does a vlookup from a table that
contains the following:


VD Vacation Day 1
PD Personal Day 1
VH Half Day Vacation Day 0.5
PH Half Day Personal Day 0.5
HO Home Office 0
AS Assignment 0


I have worksheets for every month that that has the days of the month
vertically. The user will enter one of the codes in the table
according to the type of day taken.


I have a vlookup on a totals sheet:


=VLOOKUP(January2008!C5,Codes,3,FALSE)


This works fine and gives me 1 for the output when VD is entered.


Now the issue, I want to total a row based on the value in the table,
that is if the codes for three seperate dates are, PD, PH, VD the
total should be 2.5


I tried:


=VLOOKUP(January2008!C5:AB5,Codes,3,FALSE)


but it errors out, I know I can do =VLOOKUP(January2008!C5,Codes,
3,FALSE) +VLOOKUP(January2008!D5,Codes,3,FALSE)+.......


but that would take be a huge formula.


Is there a way I can sum up the vlookup without a huge formula.


Thanks to all.


Michael Hager




Works like a charm...thanks much....

Michael Hager


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
Rounding Issues Tim Excel Discussion (Misc queries) 2 November 21st 07 09:57 PM
Hyperlink issues George Excel Discussion (Misc queries) 0 August 29th 07 02:00 AM
Cursor issues Wayne Knazek Excel Discussion (Misc queries) 0 October 12th 06 03:29 PM
links issues freekrill Excel Discussion (Misc queries) 1 November 29th 05 05:31 PM
XML Mapping Issues dpbuck Excel Discussion (Misc queries) 0 August 8th 05 11:13 PM


All times are GMT +1. The time now is 07:31 AM.

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

About Us

"It's about Microsoft Excel"