Help deciphering a formula

DEllis

Active Member
Joined
Jun 4, 2009
Messages
344
Office Version
  1. 365
Platform
  1. Windows
I have a formula, I know how it works I just don't understand what it means. Yup, I am not very proficient at excel, I just dabble and then I get thrown one like this that I have to explain to someone else and I don't think I can. So I am looking in layman terms what this formula means.

=IF(AND(I3<>0,H4=0),IF(I3+D4<0,-1,IF(I3<0,-1,1))*ABS(D4)+H4,IF(I3+D4<0,-1,1)*ABS(D4)+H4)


any help would be greatly appreciated.

thank you,
DEllis
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Reading left to right:
=IF(AND(I3<>0,H4=0),IF(I3+D4<0,-1,IF(I3<0,-1,1))*ABS(D4)+H4,IF(I3+D4<0,-1,1)*ABS(D4)+H4)

Code:
If I3 <> 0 and H4 = 0 Then
    If I3+D4<0 Then
        cell = -1
    Else
        If I3 < 0 Then
            Cell = -1 * ABS(D4)+H4
        Else
            Cell = 1 * ABS(D4)+H4
Else
    If I3+D4<0 Then
        Cell = -1 * ABS(D4)+H4
    Else
        Cell = 1 * ABS(D4)+H4

Although the IF statement is redundant in the fact that it produces nearly the same results for a true or a false statement. What is the formula MEANT to do?
 
Last edited:
Upvote 0
Way kewl!!! Thank you so much that makes more sense to see it broken down as you have it here. I appreciate the quick response.

DEllis
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,853
Members
452,948
Latest member
UsmanAli786

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