IF and Xlookup not showing expected result

PaulyK

Board Regular
Joined
Aug 27, 2015
Messages
50
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Hi,

So I am having some issues with Status & RAG Report I have adapted from a previous question. It had all been working fine, but i came back from being away to find it wasn't working properly.

The Main report has automated data from a Data Extract (for Budget, Dates, Project Name etc) which you just enter the Project Number into Column A and it updates the fields There is a RAG Scoring table which looks to see if 3 criteria are matched or not and gives a score. (Criteria Tracker Updated (Yes / No) End Date passed (Yes / No) Budget Exceeds amount (Yes / No)

When i reverse sort the Status Report Project Number the results don't match, It doesn't appear to be from not locking the range, but that I am missing a step where it is selecting the correct row to look up (thus allowing me to sort in any order) The Result is leaving blank cells when there should be a Red, Amber, Green etc.

The RAG Score is calculated using the below formula:

=IF('Project Status Summary'!C3="Tier 3","No RAG (Tier 3)",SWITCH(IFNA(XLOOKUP('Project Status Summary'!B3,[Project],[Score]),""),$H$2,$J$2,$H$3,$J$3,$H$4,$J$4,$H$5,$J$5,""))

but it seems to be a little unstable...

I've included all below... Any help much appreciated.

Pauly


Project Report
Project Status Summary - Update.xlsm
ABCDEFGHIJKL
2Project #Project NameProject TierProject ManagerStatusOverall RAGTrackerApproved BudgetActual SpendDifferenceStart DateCompletion Date
3200000Project 1Tier 2Person 2PendingAmberNo£ 12,000.00£ 3,500.00£8,500.0003/05/2229/09/22
4200001Project 2Tier 2Person 2PendingGreenYes£ -£ -£0.0031/05/2229/09/22
5200002Project 3Tier 2Person 17PendingAmberNo£ -£ -£0.0018/07/2202/09/22
6200003Project 4Tier 3Person 3Work in ProgressNo RAG (Tier 3)Yes£ 14,000.00£ 13,000.00£1,000.0001/07/2231/10/22
7200004Project 5Tier 3Person 10Work in ProgressNo RAG (Tier 3)Not on Tracker£ 7,450.00£ 1,670.00£5,780.0001/06/2230/09/22
8200005Project 6Tier 3Person 10Work in ProgressNo RAG (Tier 3)Yes£ 1,200.00£ 1,300.00-£100.0001/06/2231/10/22
9200006Project 7Tier 1Person 38PendingAmberNo£ -£ -£0.0031/05/2229/09/22
10200007Project 8Tier 2Person 36PendingGreenYes£ 11,000.00£ -£11,000.0031/05/2230/08/22
11200008Project 9Tier 2Person 13Work in ProgressGreenYes£ 76,000.00£ -£76,000.0018/07/2217/11/22
12200009Project 10Tier 1Person 14PendingGreenYes£ -£ -£0.0031/05/2230/12/22
13200010Project 11Tier 1Person 9PendingAmberYes£ -£ 261,404.00-£261,404.0021/04/2229/06/22
14200011Project 12Tier 3Person 1Work in ProgressNo RAG (Tier 3)Yes£ 76,000.00£ 54,000.00£22,000.0006/06/2223/06/22
15200012Project 13Tier 3Person 24Work in ProgressNo RAG (Tier 3)Yes£ -£ -£0.0030/05/2209/06/22
16200013Project 14Tier 2Person 17Work in ProgressGreenYes£ 62,000.00£ 45,000.00£17,000.0030/05/2229/09/22
17200014Project 15Tier 3Person 7Work in ProgressNo RAG (Tier 3)Yes£ 18,000.00£ 800.00£17,200.0025/04/2224/03/23
18200015Project 16Tier 2Person 13Work in ProgressGreenYes£ 54,840.00£ 23,232.00£31,608.0030/05/2228/07/22
19200016Project 17Tier 1Person 16PendingGreenYes£ -£ -£0.0004/05/2228/07/22
20200017Project 18Tier 3Person 10Work in ProgressNo RAG (Tier 3)Yes£ 1,500.00£ 1,600.00-£100.0016/05/2201/08/22
21200020Project 21Tier 3Person 16Work in ProgressAmberNo£ -£ 2,720.00-£2,720.0007/02/2230/06/22
22200021Project 22Tier 1Person 8Work in ProgressAmberYes£ 160,300.00£ 160,000.00£300.0019/01/2221/02/22
23200022Project 23Tier 2Person 1Work in Progress No£ 15,250.00£ 10,561.00£4,689.0007/02/2201/06/22
24200023Project 24Tier 1Person 5Work in Progress NO£ 170,600.00£ 40,242.00£130,358.0013/01/2230/05/22
25        
26
27Enter 200024 in A25
Project Status Summary
Cell Formulas
RangeFormula
B3:B25B3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Project name]),"")
C3:C25C3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Type]),"")
D3:D25D3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Project manager]),"")
E3:E25E3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Status(state)]),"")
F3:F25F3=IFERROR(XLOOKUP([@[Project '#]],'RAG Score'!$A$2#,TblRAGScore[RAG]),"")
H3:H25H3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Approved budget]),"")
I3:I25I3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Actual spend]),"")
J3:J25J3=IFERROR([@[Approved Budget]]-[@[Actual Spend]]," ")
K3:K25K3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Planned start date]),"")
L3:L25L3=IFERROR(XLOOKUP(TEXT($A3,"######"),TblPPMEx[Project number],TblPPMEx[Forecast end date]),"")
Named Ranges
NameRefers ToCells
rngActSpnd=TblPPMEx[Actual spend]I3:I25
rngAppBud=TblPPMEx[Approved budget]H3:H25
rngForEnd=TblPPMEx[Forecast end date]L3:L25
rngPM=TblPPMEx[Project manager]D3:D25
rngProjID=TblPPMEx[Project number]B3:E25, H3:I25, K3:L25
rngProjIDRAG='RAG Score'!$A$2:$A$24F3:F25
rngProjName=TblPPMEx[Project name]B3:B25
rngProjStat=TblPPMEx[Status(state)]E3:E25
rngStart=TblPPMEx[Planned start date]K3:K25
rngTier=TblPPMEx[Type]C3:C25
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F3:F25Expression=$F3=Lists!$B$5textNO
F3:F25Expression=$F3=Lists!$B$2textNO
G3:G25Cell Valuecontains "Not on Tracker"textNO
F3:F25Expression=$F3=Lists!$B$3textNO
F3:F25Expression=$F3=Lists!$B$4textNO
J3:J25Cell Value<-1000textNO
I3:I25Expression=ISBLANKtextNO
G3:G25Expression=$G3="Tier 3 Project"textNO
I3:I25Expression=$I3>$H3textNO
I3:I25Expression=$I3<=$H3textNO
G3:G29Expression=$G3="No"textNO
G3:G29Expression=$G3="Yes"textNO
L3:L25Expression=AND($L3>TODAY(), $L3-TODAY()<=30)textNO
L3:L25Expression=$L3<TODAY()textNO
L3:L25Expression=$L3=TODAY()+30textNO
B3:B25Cell ValueduplicatestextNO


PPM Extract
Project Status Summary - Update.xlsm
ABCDEFGHIJK
1Project numberProject nameTypeCategoryBudget categoryStatus(state)Approved budgetActual spendProject managerPlanned start dateForecast end date
2200000Project 1Tier 2Cat 1BlankPending£12,000.00£3,500.00Person 203/05/2229/09/22
3200001Project 2Tier 2Cat 1BlankPending£0.00£0.00Person 231/05/2229/09/22
4200002Project 3Tier 2Cat 1BlankPending£0.00£0.00Person 1718/07/2202/09/22
5200003Project 4Tier 3Cat 1BlankWork in Progress£14,000.00£13,000.00Person 301/07/2231/10/22
6200004Project 5Tier 3Cat 1BlankWork in Progress£7,450.00£1,670.00Person 1001/06/2230/09/22
7200005Project 6Tier 3Cat 1BlankWork in Progress£1,200.00£1,300.00Person 1001/06/2231/10/22
8200006Project 7Tier 1Cat 1BlankPending£0.00£0.00Person 3831/05/2229/09/22
9200007Project 8Tier 2Cat 1BlankPending£11,000.00£0.00Person 3631/05/2230/08/22
10200008Project 9Tier 2Cat 1BlankWork in Progress£76,000.00£0.00Person 1318/07/2217/11/22
11200009Project 10Tier 1Cat 1BlankPending£0.00£0.00Person 1431/05/2230/12/22
12200010Project 11Tier 1Cat 1BlankPending£0.00£261,404.00Person 921/04/2229/06/22
13200011Project 12Tier 3Cat 1BlankWork in Progress£76,000.00£54,000.00Person 106/06/2223/06/22
14200012Project 13Tier 3Cat 1BlankWork in Progress£0.00£0.00Person 2430/05/2209/06/22
15200013Project 14Tier 2Cat 1BlankWork in Progress£62,000.00£45,000.00Person 1730/05/2229/09/22
16200014Project 15Tier 3Cat 1BlankWork in Progress£18,000.00£800.00Person 725/04/2224/03/23
17200015Project 16Tier 2Cat 1BlankWork in Progress£54,840.00£23,232.00Person 1330/05/2228/07/22
18200016Project 17Tier 1Cat 1BlankPending£0.00£0.00Person 1604/05/2228/07/22
19200017Project 18Tier 3Cat 1BlankWork in Progress£1,500.00£1,600.00Person 1016/05/2201/08/22
20200018Project 19Tier 2Cat 1BlankWork in Progress£50,000.00£0.00Person 2304/05/2229/07/22
21200019Project 20Tier 2Cat 1BlankWork in Progress£65,450.00£0.00Person 1131/03/2231/05/22
22200020Project 21Tier 3Cat 1BlankWork in Progress£0.00£2,720.00Person 1607/02/2230/06/22
23200021Project 22Tier 1Cat 1BlankWork in Progress£160,300.00£160,000.00Person 819/01/2221/02/22
24200022Project 23Tier 2Cat 1BlankWork in Progress£15,250.00£10,561.00Person 107/02/2201/06/22
25200023Project 24Tier 1Cat 1BlankWork in Progress£170,600.00£40,242.00Person 513/01/2230/05/22
26200024Project 25Tier 1Cat 1BlankWork in Progress£130,000.00£24,918.00Person 616/12/2131/03/23
PPM Extract
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B26Cell ValueduplicatestextNO


RAG Score Table
Cell Formulas
RangeFormula
A2:A26A2=UNIQUE(TblPPMEx[Project number])
B2:B26B2=XLOOKUP(A2,TblPPMEx[Project number],TblPPMEx[Project name])
C2:C26C2=IF('Project Status Summary'!G3="Yes", "1", "2")
D2:D26D2=IF('Project Status Summary'!J3<-1000,"2","1")
E2:E26E2=IF('Project Status Summary'!L3<=TODAY(),"2","1")
F2:F26F2=C2+D2+E2
G2:G26G2=IF('Project Status Summary'!C3="Tier 3","No RAG (Tier 3)",SWITCH(IFNA(XLOOKUP('Project Status Summary'!B3,[Project],[Score]),""),$H$2,$J$2,$H$3,$J$3,$H$4,$J$4,$H$5,$J$5,""))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
rngProjID=TblPPMEx[Project number]A2:B26
rngProjIDRAG='RAG Score'!$A$2:$A$24B2
rngProjName=TblPPMEx[Project name]B2:B26
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G2:G26Expression=$G2=Lists!$B$5textNO
G2:G26Expression=$G2=Lists!$B$3textNO
G2:G26Expression=$G2=Lists!$B$4textNO
G2:G26Expression=$G2=Lists!$B$2textNO
F2:F26Expression=$F2=3textNO
F2:F26Expression=$F2=4textNO
F2:F26Expression=$F2=5textNO
F2:F26Expression=$F2=6textNO


RAG Criteria
Project Status Summary - Update.xlsm
HIJ
1ScoreCriteriaRAG
23All 3 Criteria MatchedGreen
34Total 4 PointsAmber
45Total 5 PointsAmber
56No Criteria MatchedRed
6ExceptionTIER 3 ProjectNo RAG (Tier 3)
RAG Score
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J2:J6Expression=$J2="No RAG (Tier 3)"textNO
J2:J6Expression=$J2="Red"textNO
J2:J6Expression=$J2="Amber"textNO
J2:J6Expression=$J2="Green"textNO
Cells with Data Validation
CellAllowCriteria
J2:J6List=rngRAG
H2:H5List=rngRAGCnt


Project Status Summary - Update.xlsm
K
1RAG Score criteria
2Tracker
3Was Tracker updated? 1 = Yes, 2 = No
4Budget
5If Difference is >£1000 =2, Less than or equal to =1
6Date
7If Date has passed =2, otherwise =1
8Total Score out of 6
9TIER 3 Projects are automatically 'NO RAG (Tier 3)'
RAG Score
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Not sure if the Title is correct for this post?
 
Upvote 0

Forum statistics

Threads
1,223,947
Messages
6,175,560
Members
452,652
Latest member
eduedu

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