+ Reply to Thread
Results 1 to 3 of 3

If then statement

  1. #1
    Registered User
    Join Date
    07-26-2007
    Posts
    1

    If then statement

    I am trying to add numbers in a formula but one of the numbers contains a letter (i.e. 1231.44 + 456.77 D). The D is for debit in this case (accounting) and I think I can use an If then statement. Can anyone help?

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565
    Hi there,

    Assuming the numbers start in cell A1, enter/copy the formula below into whatever cell you like and copy down as required. You haven't mentioned it, but the formula only deals with D (debit) entries so you'll have to tweak it if there are C's (credit) entries as well.

    HTH

    Robert

    =IF(ISERROR(SEARCH("D",A1)),A1,ABS(LEFT(A1,SEARCH("D",A1)-2)))

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by tedd
    I am trying to add numbers in a formula but one of the numbers contains a letter (i.e. 1231.44 + 456.77 D). The D is for debit in this case (accounting) and I think I can use an If then statement. Can anyone help?
    Hi,

    together with Robert's answer, you can display a number followed by a D or C and still be able to use that number in calculations. Set the cell format to Custom with something like $#,##0.00" D";$#,##0.00" C" or $ ###,##0.00" DR";$ ###,##0.00" CR" etc

    hth
    ---
    Si fractum non sit, noli id reficere.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1