Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Creating a function

All,

I created a spreadsheet and would like some assistance in creating a
function or formula. The example below best describes the spreadsheet that I
have:
A B C D
1 AD AA CAD 70
2 AA PEN PM 60
3 PR VP LR 40

Column A = Billing Rate
Column B = Labour Code
Column C = Staff code
Column D = $ amount

On a seperate worksheet, if row showed up as AD-AA-CAD, I would like colum D
automaticaly add the $ amount(70). If a row showed up as AA-PEN-PM, column D
would show up as $60. It is crucial that the formula looks through colum A
first, then B, and lastly C.

Your anticipated assistance is greatly appreciated.
Rick

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Creating a function

=SUMPRODUCT(--(Sheet1!A1:A3="AD"),--(Sheet1!B1:B3="AA"),--(Sheet1!C1:C3="CAD"),Sheet1!D1:D3)

Adjust range to suit



"BeginnerRick" wrote:

All,

I created a spreadsheet and would like some assistance in creating a
function or formula. The example below best describes the spreadsheet that I
have:
A B C D
1 AD AA CAD 70
2 AA PEN PM 60
3 PR VP LR 40

Column A = Billing Rate
Column B = Labour Code
Column C = Staff code
Column D = $ amount

On a seperate worksheet, if row showed up as AD-AA-CAD, I would like colum D
automaticaly add the $ amount(70). If a row showed up as AA-PEN-PM, column D
would show up as $60. It is crucial that the formula looks through colum A
first, then B, and lastly C.

Your anticipated assistance is greatly appreciated.
Rick

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hsg hsg is offline
external usenet poster
 
Posts: 40
Default Creating a function


Dear Rick,

In cell D1, instead of 70 try following formula:

=IF(AND($A9="AD",$B9="AA",$C9="CAD"),70,IF(AND($A9 ="AA",$B9="PEN",$C9="PM"),60,40))

then copy the formula down to row 3

You can keep on adding conditions in same manner upto 7 levels of If function.

Harsh

"BeginnerRick" wrote:

All,

I created a spreadsheet and would like some assistance in creating a
function or formula. The example below best describes the spreadsheet that I
have:
A B C D
1 AD AA CAD 70
2 AA PEN PM 60
3 PR VP LR 40

Column A = Billing Rate
Column B = Labour Code
Column C = Staff code
Column D = $ amount

On a seperate worksheet, if row showed up as AD-AA-CAD, I would like colum D
automaticaly add the $ amount(70). If a row showed up as AA-PEN-PM, column D
would show up as $60. It is crucial that the formula looks through colum A
first, then B, and lastly C.

Your anticipated assistance is greatly appreciated.
Rick

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 740
Default Creating a function

lets say your data is on sheet1

your criteria and formula on sheet2
e.g.

A1: "AD" B1: "AA" C1: "CAD"
on D1
=
SUM((Sheet1!A1:A10=A1)*(Sheet1!B1:B10=B1)*(Sheet1! C1:C10=C1)*(Sheet1!D1:D10))

on edit mode Press Ctrl+Shift+Enter
view formula as enclosed by braces { }



"hsg" wrote:


Dear Rick,

In cell D1, instead of 70 try following formula:

=IF(AND($A9="AD",$B9="AA",$C9="CAD"),70,IF(AND($A9 ="AA",$B9="PEN",$C9="PM"),60,40))

then copy the formula down to row 3

You can keep on adding conditions in same manner upto 7 levels of If function.

Harsh

"BeginnerRick" wrote:

All,

I created a spreadsheet and would like some assistance in creating a
function or formula. The example below best describes the spreadsheet that I
have:
A B C D
1 AD AA CAD 70
2 AA PEN PM 60
3 PR VP LR 40

Column A = Billing Rate
Column B = Labour Code
Column C = Staff code
Column D = $ amount

On a seperate worksheet, if row showed up as AD-AA-CAD, I would like colum D
automaticaly add the $ amount(70). If a row showed up as AA-PEN-PM, column D
would show up as $60. It is crucial that the formula looks through colum A
first, then B, and lastly C.

Your anticipated assistance is greatly appreciated.
Rick

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
How do I know which cell a function is called from? Murami Excel Worksheet Functions 3 November 24th 06 02:22 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
numerical integration integreat Excel Discussion (Misc queries) 4 May 12th 06 02:40 AM
Help Please! - Creating Function Calculated Fields within Pivot Tables ColinS Excel Worksheet Functions 0 April 5th 06 11:19 AM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM


All times are GMT +1. The time now is 06:14 AM.

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"