Help with formula

PM1

Board Regular
Joined
Oct 28, 2005
Messages
192
Hi Guys,

Struggling with a If Vlookup Statement.

I have =if(vlookup(b195,ITSPEND,2,="BLANKET",vlookup(b195,ITSPEND,3,0)) but theres an error and I can't see it
 
I have one sheet which is full of Purchase Order Data. From that I constucted a Pivot Table that just reports the Budget Line, PO No & Spend Year.

I used the Offset Formula as the table is continously growing.

In another sheet I have all the Budjet Data and so I have added more columns of which one is the current Purchase Order Spend against the Budget. However I had to construct another Column to show the value of the Purchase Order where the Supplier is BLANKET, the reason for BLANKET is to show a spend against a budget where a supplier has not yet been chosen.

I now have 2 columns, one will have the total spend from the pivot table where BLANKET is not met, and the other where it is met. I then have another Column for Invoiced amount and finally an Accrual Column.

That in a nut shell is it. Getting the basic data is not a problem, it is a problem when I needed to meet 2 consitions in a pivot table, and of course deal with the issues of data not being found or N/A being returned.

What are those two conditions, which ranges must these conditions meet, what is the range from which a result must be returned, and what kind of result gets returned - text or number? You can formulate the answers in terms of ITSPEND...
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
In Blanket Column I clearly state that if The Budget Line Code (B2) is found in the Pivot Table and in the Supplier Field "Blanket" is also present then give me the result, if the condition is not met then return a 0. This is because in the other column I do the same condition but without the Supplier Field being met, so a simple VLookup.

Excel Workbook
ABCD
3Sum of Ext Cost USDYears
4IT Line CodeSupplier20132014
5HM016BLANKET$ 6,894
6PACC / MDS$ 4,084
7HM016 Total$ 4,084$ 6,894
8Grand Total$ 4,084$ 6,894
9
Total IT Spend


Excel Workbook
ABCDEFGHIJKLMTUVWXY
1CAPEX / OPEXItem Line CodeLine Description2013F Local CurrencyLocal Cur2013F US$2013F EURO2014B Local CurrencyLocal Cur2014B US$2014B EUROOLD Item Line CodeBudget 2014 USDBlanket OrderLPO RaisedInvoiced 2014 USDAccrual USDVariance Against Budget USD
97OPEXHM016SERVER MAINTENANCE - AUH 6,894USD 6,894 5,225 6,894USD 6,894 5,225HM0166,894689400-6,894-6,894
IT Budget as at Nov 13
 
Upvote 0
In Blanket Column I clearly state that if The Budget Line Code (B2) is found in the Pivot Table and in the Supplier Field "Blanket" is also present then give me the result, if the condition is not met then return a 0. This is because in the other column I do the same condition but without the Supplier Field being met, so a simple VLookup...

There is a probably a good reason why the answers are not concise...

The two conditions are still not formulated in a straightforward manner. Nevertheless, venturing a guess:

Control+shift+enter, not just enter...

=IFERROR(INDEX(ResultRange,MATCH(1,IF(SupplierRange="Blanket",If(I-range=B2,1)),0)),0)

Does this help at all?
 
Upvote 0
There is a probably a good reason why the answers are not concise...

The two conditions are still not formulated in a straightforward manner. Nevertheless, venturing a guess:

Control+shift+enter, not just enter...

=IFERROR(INDEX(ResultRange,MATCH(1,IF(SupplierRange="Blanket",If(I-range=B2,1)),0)),0)

Does this help at all?

It looks better ;)

However it returned 0 instead of 6894

Pivot Table shows:-

Excel Workbook
ABCD
3Sum of Ext Cost USD*Years*
4IT Line CodeSupplier20132014
5HM016BLANKET*$ *6,894
6*PACC / MDS$ *4,084*
7HM016 Total*$ *4,084$ *6,894
8Grand Total*$ *4,084$ *6,894
Total IT Spend


And result sheet shows

Excel Workbook
ABCDEFGHIJKLMTUVWX
1CAPEX / OPEXItem Line CodeLine Description2013F Local CurrencyLocal Cur2013F US$2013F EURO2014B Local CurrencyLocal Cur2014B US$2014B EUROOLD Item Line Code*Budget 2014 USDBlanket *OrderLPO RaisedInvoiced 2014 USDAccrual USD
97OPEXHM016SERVER MAINTENANCE - AUH* * * * 6,894USD* * * * * *6,894* * * * * * * 5,225* * * * 6,894USD* * * * * *6,894* * * * *5,225HM016** * * * * * * * * * * * * * * 6,89406,8940-6,894
IT Budget as at Nov 13
 
Last edited:
Upvote 0
It looks better ;)

However it returned 0 instead of 6894

Pivot Table shows:-

Total IT Spend

*ABCD
3Sum of Ext Cost USD*Years*
4IT Line CodeSupplier20132014
5HM016BLANKET* $ *6,894
6*PACC / MDS $ *4,084*
7HM016 Total* $ *4,084 $ *6,894
8Grand Total* $ *4,084 $ *6,894

<tbody>
</tbody>

...

Is this from where a result must be fetched with as conditions (1) IT Line Code = HM016 and Supplier = BLANKET, yielding the result of 6,894?
 
Upvote 0
=IFERROR(LOOKUP(9.99999999999999E+307,INDEX(A5:D8,MATCH(1,IF(A5:A8="HM016",IF(B5:B8="BLANKET",1)),0),0)),"")

which must be confirmed with control+shift+enter, not just enter.

Aladin, this works for a single incident, ie HM016, but I have many different Project Codes in the Pivot Table which continually grows.In my VLOOKUP's I created a Range in the Pivot Table called IT SPEND which is made of =OFFSET('Total IT Spend'!$A$1,0,0,COUNTA('Total IT Spend'!$A:$A),5), so editing the formula above I constructed

=IFERROR(LOOKUP(9.99999999999999E+307,INDEX(ITSPEND,MATCH(1,IF(ITSPEND='IT Budget as at Nov 13'!B97,IF(ITSPEND="BLANKET",1)),0),0)),"")

I substituted if(A5:A8="HM016" with B97 which is the location of ITSPEND='IT Budget as at Nov 13'!B97 as that is where the referenced cell is.

Anyway it doesnt work :( , just returns Blank
 
Upvote 0
Aladin, this works for a single incident, ie HM016, but I have many different Project Codes in the Pivot Table which continually grows.In my VLOOKUP's I created a Range in the Pivot Table called IT SPEND which is made of =OFFSET('Total IT Spend'!$A$1,0,0,COUNTA('Total IT Spend'!$A:$A),5), so editing the formula above I constructed

=IFERROR(LOOKUP(9.99999999999999E+307,INDEX(ITSPEND,MATCH(1,IF(ITSPEND='IT Budget as at Nov 13'!B97,IF(ITSPEND="BLANKET",1)),0),0)),"")

I substituted if(A5:A8="HM016" with B97 which is the location of ITSPEND='IT Budget as at Nov 13'!B97 as that is where the referenced cell is.

Anyway it doesnt work :( , just returns Blank

If we want to refer to the dynamic named range ITSPEND, we must pick out the right parts from it...

=IFERROR(LOOKUP(9.99999999999999E+307,INDEX(ITSPEND,MATCH(1,IF(INDEX(ITSPEND,0,1)='IT Budget as at Nov 13'!B97,IF(INDEX(ITSPEND,0,2)="BLANKET",1)),0),0)),"")

which is still to be confirmed with control+shift+enter, not just enter.
 
Upvote 0
I was too getting the same problem. I tried this formula=if(vlookup(b195,ITSPEND,2,0)="BLANKET",vlookup(b195,ITSPEND,3,0))and this really helped me out.Thank u and keep updating with such formulae.
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,289
Members
449,149
Latest member
mwdbActuary

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