Creating a Cost Profile - excel

Can anyone help me with this little problem. I will try and explain as bets i can!!
We have a P6 schedule exported into Excel (Dont ask why we dont just do this in P6) and a some estimates. We have a start and finish date for each activity from the schedule dump and the cost of each activity from the estimte. What we would like to be able to do is be able to spread these costs in a cost loaded curve. Simple enough if every activity will have the same cost profile. But they dont and here is the tricky bit. We would like to be able to select the profile 6 in all and then excel would do its magic and proportion the cost between the 2 dates according to the cost profile selected... Simples, I hope!!
Curve Profiles
1 10% 10% 10% 10% 10% 10% 10% 10% 10% 10% 100%
2 1% 2% 3% 7% 13% 17% 20% 19% 13% 5% 100%
3 5% 13% 19% 20% 17% 13% 7% 3% 2% 1% 100%
4 3% 7% 11% 14% 15% 15% 14% 11% 7% 3% 100%
5 100% 0% 0% 0% 0% 0% 0% 0% 0% 0% 100%
6 0% 0% 0% 0% 0% 0% 0% 0% 0% 100% 100%
P6 is Primavera is a planning tool. We are going to use polynomial formula to determine what the split is along the line for the total value. =3.10862446895044E-15*C16^6 + 0.0000128205126657122*C16^5 - 0.000384615378834496*C16^4 + 0.00211538450821536*C16^3 + 0.0173076931969263*C16^2 - 0.0324778592548682*C16 + 0.0136363733254257 We are struggling to work out how to get excel to determine the date set automatically. Below is a cut of the data.
Activity ID Activity Name Duration Start Finish Total Month Total Float Budgeted Total Cost
A1740 Major Permissions - Project Management 734 01-Apr-17 22-Feb-19 23 1939 £6,748,243
A1630 MPP2 - Main Site DCO Contracts 742 01-Apr-17 06-Mar-19 24 1931 £6,027,265
A1650 MPP3 - SP&C Contracts 553 01-Apr-17 08-Jun-18 15 2120 £299,795
A1660 MPP4 - Highways Contracts 443 01-Apr-17 29-Dec-17 9 2230 £881,005
A1670 MPP5 - Worker's Accomodation Contracts 445 01-Apr-17 03-Jan-18 10 2228 £920,193
A1690 MPP6 - Logistics, Park & Ride Contracts 746 01-Apr-17 12-Mar-19 24 1927 £581,667
A1720 MPP7 - Marine Licences Contracts 709 01-Apr-17 18-Jan-19 22 1964 £1,879,577
A1730 MPP8 - Environmental Permits Contracts 546 01-Apr-17 30-May-18 14 2127 £1,291,958

We did it!! Dont ask me how but someone with a much bigger brain then me worked out the formula. If anyone wants it just ask and i can send it over without the data just the formula. Here is a taster!!
Used for working out the time scale.
=IF(MONTH($D8)&YEAR($D8)=MONTH(I$2)&YEAR(I$2),(1-((DAY($D8)-1)/HLOOKUP(MONTH($D8),Monthdays,'Base Data'!$A$4,FALSE))),IF(MONTH($E8)&YEAR($E8)=MONTH(I$2)&YEAR(I$2),(DAY($E8))/HLOOKUP(MONTH($E8),Monthdays,'Base Data'!$A$4,FALSE)+H8,IF(OR(MONTH($E8)&YEAR($E8)=(MONTH(I$2)-1)&YEAR(I$2),MONTH($E8)&YEAR($E8)=12&YEAR(I$2)-1),0,IF(H8-G8>0,H8+1,H8))))
For the cost.
=IF(OR('Cumulative Cash Flow'!$G176="Linear",'Cumulative Cash Flow'!$G176="Project-S; Early",'Cumulative Cash Flow'!$G176="Project-S",'Cumulative Cash Flow'!$G176="Project-S; Late"),((VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,2,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^6+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,3,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^5+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,4,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^4+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,5,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^3+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,6,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176)^2+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,7,FALSE)*(11*'Time-Phase'!I176/'Cumulative Cash Flow'!$H176))
+VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,8,FALSE)*('Time-Phase'!I176/'Cumulative Cash Flow'!$H176))*'Cumulative Cash Flow'!$F176,IF(AND('Cumulative Cash Flow'!$G176="Upfront Payment",'Time-Phase'!I176>0,'Time-Phase'!I176<=1),'Cumulative Cash Flow'!$F176*VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,8,FALSE),IF(AND('Cumulative Cash Flow'!$G176="Final Payment",'Time-Phase'!I176='Cumulative Cash Flow'!$H176),'Cumulative Cash Flow'!$F176*VLOOKUP('Cumulative Cash Flow'!$G176,Curvetype,8,FALSE),0)))

Related

SUM and VLOOKUP combination

I have a table like this:
Year V1 V2 V3
2022 1% 2% 3%
2023 3% 1% 2%
2024 4% 3% 1%
2025 1% 4% 2%
I want to look up and sum percentages for values based on start and end years (so an outcome would look like this):
Value StartYear EndYear CumulativePercentage
V1 2022 2025 9%
V2 2023 2024 4%
V3 2022 2023 5%
Is it possible to create a single formula that would do this?
This gives you the answer for V1:
=SUMIFS(B2:B5;A2:A5;">="&B10;A2:A5;"<="&C10)

keep the header of file before sorting in csh

I have the below file.rpt:
Data Manhattan Wire Wire
Delay Distance Length Diff[%]
#############################
0.558 728.282 738.89 1%
0.481 255.258 285.887 12%
0.552 652.888 677.985 4%
0.431 420.896 477.73 14%
0.506 580.288 633.018 9%
0.388 350.22 463.05 32%
0.541 622.088 672.761 8%
0.462 384.064 586.98 53%
0.565 574.016 594.434 4%
0.470 339.268 450.927 33%
0.566 664.304 672.092 1%
0.441 436.428 534.146 22%
I'm trying to sort one of the column and keep the 3 lines header without any change.
How can I do it without manipulate to other file?
I tried something similar to the below:
head -3 file.rpt ; sort -nrk4,4 file.rpt | -
I suppose this doesn't really count as a csh answer, but:
sh -c '{ sed 3q file.rpt; sed 1,3d file.rpt | sort -nrk4,4; }'
In csh, you can do:
( sed 3q file.rpt; sed 1,3d file.rpt | sort -nrk4,4; )
You can do this:
head -3 file.rpt ; tail -n +4 file.rpt | sort -nrk4,4
-n: output the last X lines
+4: output starting with line 4. Hence skip the first 3 lines
use | to send the output of tail as the input to sort.
Result:
Data Manhattan Wire Wire
Delay Distance Length Diff[%]
#############################
0.462 384.064 586.98 53%
0.470 339.268 450.927 33%
0.388 350.22 463.05 32%
0.441 436.428 534.146 22%
0.431 420.896 477.73 14%
0.481 255.258 285.887 12%
0.506 580.288 633.018 9%
0.541 622.088 672.761 8%
0.565 574.016 594.434 4%
0.552 652.888 677.985 4%
0.566 664.304 672.092 1%
0.558 728.282 738.89 1%

Index/Match Array Not Returning Some Combinations Correctly

I am using an index/match formula as an array (provided by an awesome person on another forum) to return a specific result using 3 criteria, I just realized that a particular combination is not returning properly. The formula should return the cell that these three criteria intersect:
BM96 (LTV) LTV Data Range is AZ60:AZ69
BM97 (Coverage) Coverage Data Range is BA60:BA69
BM98 (Credit Score) Credit Score Range is BB59:BI59
Data Table to return value from is BB60:BI69. Here is the formula:
=IFERROR(INDEX(BB60:BI69, MATCH(IF(BM96>95%, 97%, BM96)&BM97, AZ60:AZ69&BA60:BA69,-1), MATCH(IF(BM98>760, 760,BM98), BB59:BI59,-1)), INDEX(BB60:BI69, MATCH(IF(BM96>95%, 97%, BM96)&BM97, AZ60:AZ69&BA60:BA69, -1),MATCH(IF(BM98>760, 760, BM98), BB59:BI59,-1)))*100
(I am pressing Ctrl+Sht+Enter) when completing formula
When using the following combination of criteria, the result should be .96 but instead it returns .72 which is the correct column but 2 rows lower than it should be
LTV 92%
Coverage 30%
Credit Score 680
Here is the data:
AZ BA BB BC BD BE BF BG BH BI
59 LTV Coverage 760 759 739 719 699 679 659 639
60 97% 35% 0.58% 0.70% 0.87% 0.99% 1.21% 1.54% 1.65% 1.86%
61 97% 25% 0.46% 0.58% 0.70% 0.79% 0.98% 1.23% 1.31% 1.50%
62 97% 18% 0.39% 0.51% 0.61% 0.68% 0.85% 1.05% 1.17% 1.27%
63 95% 30% 0.38% 0.53% 0.66% 0.78% 0.96% 1.28% 1.33% 1.42%
64 95% 25% 0.34% 0.48% 0.59% 0.68% 0.87% 1.11% 1.19% 1.25%
65 95% 16% 0.30% 0.40% 0.48% 0.58% 0.72% 0.95% 1.04% 1.13%
66 90% 25% 0.28% 0.38% 0.46% 0.55% 0.65% 0.90% 0.91% 0.94%
67 90% 12% 0.22% 0.27% 0.32% 0.39% 0.46% 0.62% 0.65% 0.73%
68 85% 12% 0.19% 0.20% 0.23% 0.25% 0.28% 0.38% 0.40% 0.44%
69 85% 6% 0.17% 0.19% 0.22% 0.24% 0.27% 0.37% 0.39% 0.42%
I have tried lot's of things but can't seem to make this work, I know the issue is related to the LTV but can't understand why it is returning the row for 16% rather than 30%.
Any help would be greatly appreciated.
Try this alternate non-CSE formula using the newer AGGREGATE function.
=INDEX(BB60:BI69, AGGREGATE(14, 6, ROW(1:10)/((AZ60:AZ69>=MIN(AZ51, MAX(AZ60:AZ69)))*(BA60:BA69>=AZ52)), 1), IFERROR(MATCH(AZ53, BB59:BI59, -1), 1))

How to find the highest disk space usage mount?

I'm looking for a command where only the highest disk space usage mount will be shown. So The maximum %usage mount will be shown.
Running df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vx/dsk/appdg/boom-vol
1.0G 19M 943M 2% /opt/blah99
500G 349G 152G 70% /opt/blah/data
/dev/vx/dsk/isdg/boom-shared-vol
50G 1.6G 46G 4% /opt/blah99/product/shared
/dev/vx/dsk/isdg/boom-bc-vol
150G 64G 81G 45% /opt/blah99/product/a_01
/dev/vx/dsk/isdg/boom-bt-vol
150G 47G 98G 33% /opt/blah99/product/a_02
Output should be -
500G 349G 152G 70% /opt/blah/data
What you are looking for is:
df -h | grep -vw "^\/dev" | sort -k 5 -n | tail -n 2 | head -n 1
Output of df -h | grep -vw "^\/dev":
Filesystem Size Used Avail Use% Mounted on
1.0G 19M 943M 2% /opt/blah99
500G 349G 152G 70% /opt/blah/data
50G 1.6G 46G 4% /opt/blah99/product/shared
150G 64G 81G 45% /opt/blah99/product/a_01
150G 47G 98G 33% /opt/blah99/product/a_02
Sorting by column 5 in numeric order: df -h | grep -vw "^\/dev" | sort -k 5 -n:
50G 1.6G 46G 4% /opt/blah99/product/shared
1.0G 19M 943M 2% /opt/blah99
150G 47G 98G 33% /opt/blah99/product/a_02
150G 64G 81G 45% /opt/blah99/product/a_01
500G 349G 152G 70% /opt/blah/data
Filesystem Size Used Avail Use% Mounted on
Getting second row from the end: df -h | grep -vw "^\/dev" | sort -k 5 -n | tail -n 2 | head -n 1:
500G 349G 152G 70% /opt/blah/data

Sphinx claiming memory is too low and my ids are null

I am trying to index about 3,000 document but here is what I am getting
[root#domU-12-31-39-0A-19-CB data]# /usr/local/sphinx/bin/indexer --all
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/usr/local/sphinx/etc/sphinx.conf'...
indexing index 'catalog'...
WARNING: Attribute count is 0: switching to none docinfo
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 12288 kb
WARNING: source catalog: skipped 3558 document(s) with zero/NULL ids
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.040 sec, 0 bytes/sec, 0.00 docs/sec
total 1 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 5 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
I have it set to rt_mem_limit = 512M why is it telling me I dont have enough memory?
rt_mem_limit != mem_limit - they are different variables - with different purposes.
mem_limit - is the value used by indexer during indexing
http://sphinxsearch.com/docs/current.html#conf-mem-limit
- its in the 'indexer' section of your config file.
You must have it sent too loo. Either just leave it out (to use 32M), or change it to better value.
But you also have no document_ids in your dataset. Check your sql_query actully works.

Resources