This is so simple, that even I find it easy to do, with a formula...
_____ Workbook: 1.xls ( Using Excel 2007 32 bit )
Worksheet: 1-Sheet1
Row\Col A B C D E F G H I J K 1Exchange Symbol Series/Expiry Open High Low Prev Close LTP 2NSE ACC EQ 1087 1030 955.5 998.45 1079.9 22 =IF(H2>D2,1/100*H2,IF(H2<D2,1/100*H2,"D is equal to H")) =IF(H2>D2,H2-J2,IF(H2<D2,H2+J2,"D is equal to H")) 3NSE ADANIPOWER EQ 148.05 27.75 25.65 25.65 146.5 25 =IF(H3>D3,1/100*H3,IF(H3<D3,1/100*H3,"D is equal to H")) =IF(H3>D3,H3-J3,IF(H3<D3,H3+J3,"D is equal to H")) 4NSE DLF EQ 265 419.7 350.05 387.25 267.15 17388 =IF(H4>D4,1/100*H4,IF(H4<D4,1/100*H4,"D is equal to H")) =IF(H4>D4,H4-J4,IF(H4<D4,H4+J4,"D is equal to H")) 5NSE AMBUJACEM EQ 30.4 155.8 142.55 145.85 29.95 15083 =IF(H5>D5,1/100*H5,IF(H5<D5,1/100*H5,"D is equal to H")) =IF(H5>D5,H5-J5,IF(H5<D5,H5+J5,"D is equal to H"))
_____ Workbook: 1.xls ( Using Excel 2007 32 bit )
Worksheet: 1-Sheet1
Row\Col A B C D E F G H I J K 1Exchange Symbol Series/Expiry Open High Low Prev Close LTP 2NSE ACC EQ 1087 1030 955.5 998.45 1079.9 22 =IF(H2>D2,1/100*H2,IF(H2<D2,1/100*H2,"D is equal to H")) =IF(H2>D2,H2-J2,IF(H2<D2,H2+J2,"D is equal to H")) 3NSE ADANIPOWER EQ 148.05 27.75 25.65 25.65 146.5 25 =IF(H3>D3,1/100*H3,IF(H3<D3,1/100*H3,"D is equal to H")) =IF(H3>D3,H3-J3,IF(H3<D3,H3+J3,"D is equal to H")) 4NSE DLF EQ 265 419.7 350.05 387.25 267.15 17388 =IF(H4>D4,1/100*H4,IF(H4<D4,1/100*H4,"D is equal to H")) =IF(H4>D4,H4-J4,IF(H4<D4,H4+J4,"D is equal to H")) 5NSE AMBUJACEM EQ 30.4 155.8 142.55 145.85 29.95 15083 =IF(H5>D5,1/100*H5,IF(H5<D5,1/100*H5,"D is equal to H")) =IF(H5>D5,H5-J5,IF(H5<D5,H5+J5,"D is equal to H"))
Each formula uses 2 Excel If functions, one is nested in the other...
Column JCode:( If _>_ , Do this , Else [ If _<_ , Do this , Else "......" ] ) If ( _>_ , Do this , Else If( _<_ , Do this , Else "......" ) )
Column KCode:=IF(H2>D2,1/100*H2,IF(H2<D2,1/100*H2,"d is equal to H")) if column H is greater than column D then calculate 1% of column H =IF(H2>D2,1/100*H2, Else if column H is lower than column D then calculate 1% of column H IF(H2<D2,1/100*H2, Else "D is equal to H"))
Code:=IF(H2>D2,H2-J2,IF(H2<D2,H2+J2,"D is equal to H")) if column H is greater than column D subtract Column H & column J =IF(H2>D2,H2-J2, Else if column H is lower than column D add Column H & column J IF(H2<D2,H2+J2, Else "D is equal to H"))
Alan
Ref
https://support.office.com/en-us/art...rs=en-US&ad=US
https://www.techonthenet.com/excel/formulas/if.php




Reply With Quote

Bookmarks