Vlookup and hlookup combination

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,050
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

leopardhawk

Active Member
Joined
May 31, 2007
Messages
356
Office Version
2016
Platform
Windows
Hi Fluff, I have able to use your formula successfully as a template on a couple of others but on this one, I am getting the error "You've entered too few arguments for this function". The table I am accessing is called OAS_GIS_web and it's shown below the formula that is giving me the error. The amount I am trying to return is in B3 (613.53). I tried it with and without the double quotes around the "Regardless..."

Code:
=INDEX(OAS_GIS_web[Maximum monthly payment amount],MATCH("Regardless of your marital situation"),OAS_GIS_web[Your situation],0))
xl2bb.xlam
ABC
1Your situationMaximum monthly payment amountMaximum annual income to receive the OAS pension Footnote 1
2Old Age Security (OAS) pensionOld Age Security (OAS) pensionOld Age Security (OAS) pension
3Regardless of your marital status613.53$126,058 (individual income)
4Guaranteed Income Supplement (GIS) amounts for individuals receiving a full Old Age Security (OAS) pension.Guaranteed Income Supplement (GIS) amounts for individuals receiving a full Old Age Security (OAS) pension.Guaranteed Income Supplement (GIS) amounts for individuals receiving a full Old Age Security (OAS) pension.
5If you are a single, widowed or divorced pensioner916.38$18,600 (individual income)
6If your spouse/common-law partner receives the full OAS pension551.63$24,576 (combined income)
7If your spouse/common-law partner does not receive an OAS pension916.38$44,592 (combined income)
8If your spouse/common-law partner receives the Allowance551.63$44,592 (combined income)
Sheet2
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,050
Office Version
365
Platform
Windows
You've got an extra bracket in there that doesn't belong, you need to remove it
"Regardless of your marital situation"),OAS_GIS_web
 

leopardhawk

Active Member
Joined
May 31, 2007
Messages
356
Office Version
2016
Platform
Windows
I must be getting tired... Thank you SO much! I also realized that I had another typo in the formula... "Regardless of your marital situation" instead of "Regardless of your marital status" Thanks for your guidance and help!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,050
Office Version
365
Platform
Windows
My pleasure
 

leopardhawk

Active Member
Joined
May 31, 2007
Messages
356
Office Version
2016
Platform
Windows
Fluff, hopefully, the last question related to your original formula. In the table below, we have successfully written two formulas that return the amounts that are currently in B3 and B5. I thought it would be easy to combine these two formulas in a SUM formula to add those two amounts together using the same logic, but my attempt at a formula returns $0.00 when it should return $1529.91. Can you help? Thanks!

Code:
=SUM(INDEX(OAS_GIS[Maximum monthly payment amount],MATCH("Regardless of your marital status",OAS_GIS[Your situation],0)),INDEX(OAS_GIS[Maximum monthly payment amount],MATCH("If you are a single, widowed or divorced pensioner",OAS_GIS[Your situation],0)))
xl2bb.xlam
ABC
1Your situationMaximum monthly payment amountMaximum annual income to receive the OAS pension Footnote 1
2Old Age Security (OAS) pensionOld Age Security (OAS) pensionOld Age Security (OAS) pension
3Regardless of your marital status613.53$126,058 (individual income)
4Guaranteed Income Supplement (GIS) amounts for individuals receiving a full Old Age Security (OAS) pension.Guaranteed Income Supplement (GIS) amounts for individuals receiving a full Old Age Security (OAS) pension.Guaranteed Income Supplement (GIS) amounts for individuals receiving a full Old Age Security (OAS) pension.
5If you are a single, widowed or divorced pensioner916.38$18,600 (individual income)
6If your spouse/common-law partner receives the full OAS pension551.63$24,576 (combined income)
7If your spouse/common-law partner does not receive an OAS pension916.38$44,592 (combined income)
8If your spouse/common-law partner receives the Allowance551.63$44,592 (combined income)
Sheet2
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,050
Office Version
365
Platform
Windows
That formula looks fine to me. It maybe that the values in col B are text, rather than numbers.
You could try
Code:
=SUM(--INDEX(OAS_GIS[Maximum monthly payment amount],MATCH("Regardless of your marital status",OAS_GIS[Your situation],0)),--INDEX(OAS_GIS[Maximum monthly payment amount],MATCH("If you are a single, widowed or divorced pensioner",OAS_GIS[Your situation],0)))
Note the two - signs before each index
 

leopardhawk

Active Member
Joined
May 31, 2007
Messages
356
Office Version
2016
Platform
Windows
Works perfectly! Why would the two -- make a difference?

Thanks Fluff!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,050
Office Version
365
Platform
Windows
They convert a number stored as text into a number.
 

Forum statistics

Threads
1,081,676
Messages
5,360,441
Members
400,586
Latest member
Minty

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top