+ Reply to Thread
Results 1 to 6 of 6

Need to write IF formula in shorthand

  1. #1
    Registered User
    Join Date
    08-27-2007
    Posts
    3

    Smile Need to write IF formula in shorthand

    I have two columns of data, one column represents transactions and the other are dates in the month which are entered as 1 or 2 or 3 etc. From the numbers I wanted to tabulate all the transactions against cells with number 1 and 2 and 3 etc etc up to 31 days. This calculates the total of transactions for each day. The number of transactions per day is random and can be none or up to 12 or so. This is a sample the formula I used:

    =IF((A13=1),(B13))+IF((A14=1),(B14))+IF((A15=1),(B15))+IF((A16=1),(B16))

    then for No. 2s =IF((A13=2),(B13))+IF((A14=2),(B14))+IF((A15=2) etc etc

    Sometimes there may be no entries for the first few days of the month. Other days may have no data.

    This formula works but as you continue producing code for consecutive days you need more and more repetitions of the formula and eventually my Excel gave a message "Formula Too Long".

    I would be grateful if anybody might suggest a shorthand way of writing the formula as I have researched it on the web and tried everything without success.

    Thank you for any help or suggestions.

    MikeX

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Perhaps Sumif()?

    =Sumif(A13:A16,1,B13:B16)

    This will sum values in B13:B16 which having a corresponding 1 in A13:A16


    adjust ranges to suit.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-27-2007
    Posts
    3

    RE: Need to write IF formula in shorthand

    p.s. I need to use a range of 500 rows for this formula as by day 31 the transactions may extend as a list to 300 or more cells. Although early in the month the number of rows used would be limited by end of month a longer list would have been generated, hence the need to cover a long range.

    Any help most appreciated.

    MikeX

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    See my response just previous to your last message...

    Adjust the ranges to include the 500 rows.

  5. #5
    Registered User
    Join Date
    08-27-2007
    Posts
    3

    Re: Need to write IF formula in shorthand

    NBVC

    Absolutely brilliant Sir and it works perfectly. I cannot believe how quickly you responded. Thank you so much. I will be staying with this forum and maybe I will learn something.

    MikeX

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by MikeX
    NBVC

    Absolutely brilliant Sir and it works perfectly. I cannot believe how quickly you responded. Thank you so much. I will be staying with this forum and maybe I will learn something.

    MikeX
    You're welcome and enjoy your stay!

+ 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