Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Excel Solutions 2016.doc
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
813.06 Кб
Скачать

Similar tasks

Things to remember about lists:

  • They are only visible when the cell is active.

  • They cannot have labels that appear in the list instead of values they provide. There are some workarounds for that, though.

  • If a worksheet is not protected and validated cell is locked, your validated cell can be overwritten by just copying and pasting something over it. Watch out.

Compare positive and negative numbers

Tools: Function ABS

Level: advanced

Problem

Your company has a revolving credit line from its bank. It can borrow from bank up to a certain limit whenever your company needs cash. Every time your company has excess cash that exceeds one month of projected expenses, it pays this bank loan off – provided it still owes anything to the bank. You calculate or get from external source the loan balance and you have your company's cash position. However, the cash position is a positive number and loan balance is a negative number. If loan balance is zero, then there is no payment due, but if it is negative, then you pay the smaller of either your cash balance or sum needed to bring the loan balance to zero.

A

B

C

D

E

F

G

1

Cash balance

314

254

496

24

356

48

2

Loan balance

-395

-461

-336

-181

-279

-232

3

Payment

314

254

336

24

279

48

While it sounds and looks simple from a common sense standpoint, it is mind-twisting when it comes to setting up the math. How do you calculate what your company can pay the bank if it has to pay the bank at all?

Solution

We need to compare not cash and loan numbers but moduli of these numbers (modulus is a term for "absolute value" of the number without regard to the number sign). Then we need to select a smaller value, and this will be the payment.

  1. Active cell B3.

  2. Type or input =IF( function.

  3. Enter ABS(B1)>ABS(B2) as "logical_test". ABS() is a function that returns the modulus of the argument.

  4. If cash balance is greater than loan balance, the load balance can be paid off in full. Enter ABS(B2) as "value_if_true".

  5. If cash balance is less that loan balance, cash balance goes to pay off the loan in full. Einter ABS(B1) as "value_if_false".

  6. Close the bracket of IF function or press Enter, or click OK.

  7. Copy cell B3 to range B3:G3.

You completed function will look as

=IF(ABS(B1)>ABS(B2),ABS(B2),ABS(B1))

Formula syntax

Code

Variable

Comment

=IF(

Which is greater, cash balance or loan balance if compared as moduli?

  ABS(

Logical_test

Cash balance modulus

    B1

Cash balance

  )

Function ABS() complete

  >ABS(

Loan balance modulus

    B2

Number

Loan balance

  ),

Function ABS() complete

  ABS(

Value_if_true

If cash balance is greater, the payment is…

    B2

Number

Loan balance as positive number

  ),

Function ABS() complete

  ABS(

Value_if_false

If loan balance is equal to cash balance or greater, the payment is…

    B1

Number

Cash balance as positive number

  )

Function ABS() complete

)

Function IF() complete

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]