Consulting

Results 1 to 2 of 2

Thread: IF Statement that will assign account types based on "account number"

  1. #1

    IF Statement that will assign account types based on "account number"

    Doing a project in excel. Cannot wrap my head around how to do this. I have financial data that has "account number" (ex. 1000, 1001, etc) in column 1, "account description" (cash, a/r) in column 2 and the account balance (8,794) in column 3.
    Basically I want to know how I can construct an IF statement in VBA that says IF the value in column 1 is greater than 1000 but less than 1005 THEN assign it am "account type" value of "cash" in column 4 for all of the account numbers within this range.
    Any input would be greatly appreciated!

    Attached is the project.

    IDS 331 Project (2).xlsm

    Furthermore, I need to populate the Balance Sheet in the balance sheet tab with the right values. Would it be possible to use SUM + Vlookup in order to populate the balance sheet with the correct values after assigning "account types" as they will match the balance sheet



  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I can't open the workbook, but

    VBA If Statement:
    For Each Cel in Range("A:A")
       If Cel > 1000 And Cel < 1005 Then Cel.Offset(0, 3) = "Cash"
    Next Cel
    You can do this manually by sorting Column A, then enter "Cash" in the Account Type column next to the first 1001 account, selecting from that cell down to the cell next to the last 1004 account and pressing Ctrl + D

    For the Balance Sheet use Excel's SUMIF Function
    Last edited by SamT; 12-08-2014 at 05:08 AM.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Tags for this Thread

Posting Permissions

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