ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   HLOOKUP and SUM (https://www.excelbanter.com/excel-discussion-misc-queries/116176-hlookup-sum.html)

[email protected]

HLOOKUP and SUM
 
Hello there

I need a lookup funtion to find a year to date figure, had a look
through but cant find one to suit.
Spreadsheet looks like this:

1 2 3 4
Jan Feb Mar Apr
10 15 20 18

I have a cell on the sheet stating the period number (1-4) and i need a
function to look up the year to date fugure for that period (ie period
3 would be 45). Function i was trying to use was:

SUM(HLOOKUP(1,'Detailed OH - TSC 06-07
Budget'!$G$8:$R$188,8):HLOOKUP($R$3,'Detailed OH - TSC 06-07
Budget'!$G$8:$R$188,8)) The lookups work fine on their own but not when
i try and sum them.

Any ideas would be fantastic!

Cheers

Brian


Dave O

HLOOKUP and SUM
 
Hi, Brian-
With your sample data in A1:D3 I got the right results with this
formula:
=SUMPRODUCT(--(A1:D1<=3),A3:D3)

The plain English translation is: "if the value in A1:D1 is less than
or equal to 3, sum the corresponding values in A3:D3".

Dave O



All times are GMT +1. The time now is 08:43 AM.

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