KojakWeb

New Member
Joined
Dec 12, 2018
Messages
6
Hi,


I'm using Excel 2013 and maintaining a table which logs changes to one or more fields. The table below illustrates an example of bonus/salary/rating that could be adjusted during the project. The "O-" prefixed fields are a lookup to the original load-up data in another table. The values that I would expect to see generated by excel are in the "E-" prefixed fields. (NOTE: at this particular client I cannot use macros/plug-ins and would prefer avoiding vba)

RowStaffNoO-BonusO-SalaryO-RatingBonusSalaryRatingDateChangedE-BonusE-SalaryE-Rating
112345610002000210001/12/2018100021000
21234561000200012502/12/2018125021000
31234561000200015003/12/2018150021000
412345610002000250004/12/2018150025000
512345610002000C35/12/2018150025000C3
6123456100020009006/12/201890025000C3
712345610002000A27/12/201890025000A2
812345610002000150008/12/201890015000A2
91234561000200095019500B19/12/201895019500B1

<tbody>
</tbody>



As you can see, on different days I'll be instructed to change values for different fields. I'm struggling of thinking of a formula that would give the value I want to see in the "E-" fields generated in the above example, i.e. the latest adjusted figure that exists, otherwise it should use the value from the original load-up table. As you can see the values in the example above can go adjusted down as well as up. In essence I'm trying to avoid having to key in the values in all those three fields every time a new row is created. Thanks in advance.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
RowStaffNoO-BonusO-SalaryO-RatingBonusSalaryRatingDateChangedE-BonusE-SalaryE-Rating
1123456100020002100001/12/2018100021000
212345610002000125002/12/2018125021000
312345610002000150003/12/2018150021000
4123456100020002500004/12/2018150025000
512345610002000C305/12/2018150025000C3
61234561000200090006/12/201890025000C3
712345610002000A207/12/201890025000A2
8123456100020001500008/12/201890015000A2
91234561000200095019500B109/12/201895019500B1
in J2 (ebonus of 1000) you need this formula
=IF(F2="",C2,F2)

<colgroup><col span="8"><col><col span="5"></colgroup><tbody>
</tbody>
 
Upvote 0
Hi. I'm afraid that formula won't work for my purposes (perhaps I should have excluded row 9 to make it clearer). E.g. looking at just bonus, that formula would work for row 3 where the bonus was adjusted to be 1500, but as there is no value in the following few rows, it would return what is column 1000. I need the bonus of 1500 to be carried forward to subsequent rows until row 6, where we can see that the bonus has been entered as 900.
 
Upvote 0
In j2 copied over
=IF(F2="",C2,F2)
in J3 copied over & down
=IF(F3="",J2,F3)
 
Upvote 0
That assumes that no other rows appear with other staff numbers, and assumes that the table won't be resorted (which is why I have staffno and date as entered values). Let me re-frame my example, by introducing another employee.

Row\ColumnABCDEFGHIJK
1StaffNoO-BonusO-SalaryO-RatingBonusSalaryRatingDateChangedE-BonusE-SalaryE-Rating
2123456100020000210001/12/18100021000
312345610002000012502/12/18125021000
412345610002000015003/12/18150021000
5654321111133333A222223/12/18222233333A2
6123456100020000250004/12/18150025000
7123456100020000C35/12/18150025000C3
81234561000200009006/12/1890025000C3
9123456100020000A27/12/1890025000A2
10654321111133333A2A17/12/18222233333A1
11123456100020000150008/12/1890015000A2

<tbody>
</tbody>

I hope that illustrates what I tried to describe in my original post.
 
Upvote 0
Don't know if anyone is able to help me on this, but I was thinking that I could use offset, with a way to dynamically change how it picks up the entry the previous time a field value was entered. In the example above, for rows 7-9, the salary amount would pick up the value in F6 which is 25k.
 
Upvote 0
I think I found a way to do it, it requires the addition unique identifier column for each of the fields that's recording a change. So for the Bonus field, it's creating a unique identifier, combining staffno and the last date a row received a bonus entry:

UniqueDateBonus
{=[@StaffNo]&IF([@Bonus]<>"",[@DateChanged],MAX(IF([StaffNo]=[@StaffNo],(IF([DateChanged]<[@DateChanged],IF([Bonus]<>"",[DateChanged]))))))}


Then it's an index/match to return the relevant bonus entry, unless the date component in the above formula returns a 0 (i.e. first row entered into the log doesn't contain an entered value for Bonus, or if all the entries in the log don't have a value for Bonus) in which case use the O-Bonus value.

E-Bonus
{=IF(IF([@Bonus]<>"",[@DateChanged],MAX(IF([StaffNo]=[@StaffNo],(IF([DateChanged]<[@DateChanged],IF([Bonus]<>"",[DateChanged]))))))=0,[@[O-Bonus]],INDEX([Bonus],MATCH([@UniqueDateBonus],[UniqueDateBonus],0)))}

I would welcome any suggestions if anyone has a more elegant way of doing this.
 
Upvote 0

Forum statistics

Threads
1,214,893
Messages
6,122,121
Members
449,066
Latest member
Andyg666

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