Re: Providing AND operation in calculating a line item.
Without knowing anything else about what you are doing, the formula looks fine. Using AND is common. if you need a second (stand-alone) condition, then use ELSE IF...
Note that the sum statement (SUM: 'ModuleName1'.Type) implies that the value you are summing by (i.e. Type) is a dimension of the result (which means that Type is a dimension of the Line Item* the formula is in).
*Note: Demension of the result technically refers to the dimensions of line item that the formula is in. In most cases, this will be the dimensions of the module as a whole, but the dimensions could be unique to the line item itself if the line item is a subsidiary view... that is, if the line item has different lists/dimensions than the related module).