Index match inside an If for Google Sheets.

plant007

Board Regular
Joined
Jun 2, 2011
Messages
55
Office Version
  1. 2019
Platform
  1. Windows
Hi

I am trying to compare a 'work start date' (first column) against the last spend entry in an annual profile, in the case below its 'Prior years spend'. This is to show whether the 'work start date' is before or after the last annual profile spend entry. Basically its a logic check as 'start of works' should not be after the last annual profile spend entry. In the case below, the entry is wrong as start of works is in 2034 while last spend is prior to 2023/24. I am using Index Match within an If as follows, and then concatenate a message but always get an #N/A;

=if(INDEX('3. Planned Investment'!$2:$2,MAX(IF('3. Planned Investment'!AD8:AP8<>0,COLUMN('3. Planned Investment'!AD8:AP8),"Prior Years' Spend (£m)",concatenate("As last profile is Prior Years' Spend, CHECK against ", TEXT('3. Planned Investment'!Z8,"DD/MM/YYYY"),"")))))

1683753604686.png


Be really grateful for any help on this as cant seem to solve it!
Cheers
Andy
 
Last edited by a moderator:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
i'm trying to parse out your formula. what is the condition the first IF statement is checking? I do not see an expression.
 
Upvote 0
Apologies, first IF is meant to find the last annual profile with spend in it and if it is 'Prior Years spend', then produce a message (the reason for this is I cannot compare a start date year against that field as its labelled as text and covers many undetermined years
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks and have updated Account details - although I am on 2019 version, I am actually working at the moment in google sheets for version control / sharing purposes with collegues
 
Upvote 0
Try
Excel Formula:
=IF(INDEX('3. Planned Investment'!$2:$2,MAX(IF('3. Planned Investment'!AD8:AP8<>0,COLUMN('3. Planned Investment'!AD8:AP8))))="Prior Years' Spend (£m)",CONCATENATE("As last profile is Prior Years' Spend, CHECK against ", TEXT('3. Planned Investment'!Z8,"DD/MM/YYYY"),""))
 
Upvote 0
Try
Excel Formula:
=IF(INDEX('3. Planned Investment'!$2:$2,MAX(IF('3. Planned Investment'!AD8:AP8<>0,COLUMN('3. Planned Investment'!AD8:AP8))))="Prior Years' Spend (£m)",CONCATENATE("As last profile is Prior Years' Spend, CHECK against ", TEXT('3. Planned Investment'!Z8,"DD/MM/YYYY"),""))
Many thanks for this and I will try it this afternoon
 
Upvote 0

Forum statistics

Threads
1,215,284
Messages
6,124,067
Members
449,140
Latest member
SheetalDixit

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