formula help (If statment)

shehla.uhp1

New Member
Joined
May 23, 2012
Messages
14
Hi,

I am looking for formula for the following condition.

I have a table that has columns:


TypeGrossDetail.DebitDetail.Credit
CR
17250 17250
CP3150.83150.8
CP
500500
DI500 500
CI500500

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>


I am looking for any if functions so that If type is CR the Detail Credit column pick the gross value and detail debit column left blank.

For type CR,CI the gross should be shifted to detail credit column.
For type CP,DI the gross should be shifted to detail debit column.

Thanks.
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
In C2:

=IF(OR(A2="CP",A2="DI"),B2,"")

and in D2:

=IF(OR(A2="CR",A2="CI"),B2,"")

Copy the formulas down.
 

anandvarma

Active Member
Joined
Apr 26, 2011
Messages
384
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
in cell c2 try this
=IF(OR(INDIRECT("a"&ROW())="CP",INDIRECT("a"&ROW())="DI"),INDIRECT("b"&ROW()),"") and drag it down

in cell D2 try this
=IF(OR(INDIRECT("a"&ROW())="CR",INDIRECT("a"&ROW())="CI"),INDIRECT("b"&ROW()),"") and drag it down
 

Watch MrExcel Video

Forum statistics

Threads
1,122,842
Messages
5,598,394
Members
414,234
Latest member
grlevesq

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
Top