vlookup on filtered list with sum

Achelois

New Member
Joined
May 24, 2011
Messages
5
I have a workbook containing two sheets.

Sheet 1 - is a table with Team, and cost
The list has an autofilter in place
In cell F20 I have a total for the cost field
In cell F21 I need to put in a formula which will do a number of things

1) The formula needs to refer to the table above, look at the filtered column (a) and see the value

2) Refer to sheet 2, look up value found in column a on sheet 1 and then take the value from this table

3) Return to sheet 1 using the value and subtract it from F20.

I have managed all of the above.

The only problem I now have is that when the list is unfiltered, I want the F20 formula (steps 1-3 above) to not perform the vlookup etc but to sum the cost column on sheet 1

The formula I have is

=VLOOKUP(INDEX(A2:A15,MATCH(1,(SUBTOTAL(3,OFFSET(A2:A15,ROW(A2:A15)-MIN(ROW(A2:A15)),0,1)))*(A2:A15<>""),0)),'Team Totals'!A1:C7,3,FALSE)-F20

Basically, if column A is unfiltered then DONT do the above formula but sum the Cost column on sheet 1, otherwise - DO the formula above?!

Any help gratefully appreciated

A
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top