Large/Countif Not Giving Me The Correct K

DR RENO

Board Regular
Joined
Jun 29, 2018
Messages
65
Need excel gurus to help spot what's going on here. I have a named range that has a value for each of 10 periods. I'm using a Large/Countif formula to identify from other IF statement criteria, which period in named range would be captured for the table I have the formula in. My forumla works for just about every value I put in the reference cell (G5), but for some reason any number below 28,200 gives me the same number for year 3, year 4, and year 5. Any value above 28200, gives the correct increment in accordance to the named range. I have nothing in my formula that should put constraints in to do this. I'm not seeing what could be causing this problem. Any help you can give would be much appreciated.
=IF(C12>=$L$2,$L$2,LARGE(PositionC,COUNTIF(PositionC,">"&C12)))
Here's The File
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I think it's a floating point issue. Round the formulas in the pay increase cells to 3 decimal places and it should sort it.
 
Upvote 0
I think your problem is that there is precision greater than 3 in your numbers. If you round the salaries in PositionC to 2 dec pl, or even 3, it should work.
 
Last edited:
Upvote 0
i've put 35000 in G5 with results below, are those the numbers expected?


Book1
ABCDEFG
1Position C - Minimum Starting Salary (Business Case Proposal)$26,285Year1Year2Year3Year4Year5
2Annual Pay Increase3.50%$26,285.000$27,204.975$28,157.149$29,142.649$30,162.642
3Standard
4
5Start Date1-Feb-152015Actual Starting Salary$30,500Current Salary$ 35,000.00
6Current Date16-May-1920163.50%
7Years With Company420173.50%
820183.50%
920193.50%
10
11Scenarios5-Year CostYear1Year2Year3Year 4Year5
121. Using The Salary Range In B1:L1$178,295$35,000.000$35,823.757$35,823.757$35,823.757$35,823.757
132. Using Starting Salary as Current Salary w/ Pay increase 3.5% per year until Max Salary (As Discussed morning of 2-May-19)$178,295$35,000$35,824$35,824$35,824$35,824
Salary Analysis Example
Cell Formulas
RangeFormula
D12{=IF(C12>=$L$2,$L$2,LARGE(PositionC,COUNTIF(PositionC,">"&C12)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
i've put 35000 in G5 with results below, are those the numbers expected?

ABCDEFG
1Position C - Minimum Starting Salary (Business Case Proposal)$26,285Year1Year2Year3Year4Year5
2Annual Pay Increase3.50%$26,285.000 $27,204.975 $28,157.149 $29,142.649 $30,162.642
3Standard
4
5Start Date1-Feb-152015Actual Starting Salary$30,500Current Salary$ 35,000.00
6Current Date16-May-1920163.50%
7Years With Company420173.50%
820183.50%
920193.50%
10
11Scenarios5-Year CostYear1Year2Year3Year 4Year5
121. Using The Salary Range In B1:L1$178,295 $35,000.000 $35,823.757 $35,823.757 $35,823.757 $35,823.757
132. Using Starting Salary as Current Salary w/ Pay increase 3.5% per year until Max Salary (As Discussed morning of 2-May-19)$178,295 $35,000 $35,824 $35,824 $35,824 $35,824

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Salary Analysis Example

Array Formulas
CellFormula
D12{=IF(C12>=$L$2,$L$2,LARGE(PositionC,COUNTIF(PositionC,">"&C12)))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

It does, but when you change G5 to 22,000 it does not work. Making it an array does not fix the problem.
 
Upvote 0
ok, would you let us know with 22000 in G5, which cells give wrong answer and what are they supposed to be?


Book1
ABCDEFG
1Position C - Minimum Starting Salary (Business Case Proposal)$26,285Year1Year2Year3Year4Year5
2Annual Pay Increase3.50%$26,285.000$27,204.975$28,157.149$29,142.649$30,162.642
3Standard
4
5Start Date1-Feb-152015Actual Starting Salary$19,172Current Salary$ 22,000.00
6Current Date16-May-1920163.50%
7Years With Company420173.50%
820183.50%
920193.50%
10
11Scenarios5-Year CostYear1Year2Year3Year 4Year5
121. Using The Salary Range In B1:L1$137,961$26,285.000$27,204.975$28,157.149$28,157.149$28,157.149
132. Using Starting Salary as Current Salary w/ Pay increase 3.5% per year until Max Salary (As Discussed morning of 2-May-19)$140,952$26,285$27,205$28,157$29,143$30,163
Salary Analysis Example
 
Upvote 0
from what I can see, with 35,000 Rows 12 & 13, Years 2 to 5 are identical,

as with 22,000, Row 12 Years 3 to 5 are identical
 
Upvote 0
May I recommend posts #2 and #3 ? :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,772
Messages
6,126,810
Members
449,339
Latest member
Cap N

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