How to Find Specific Text and Calculate Taxable Values in Excel
Question details
The user needs an Excel formula to check if a cell starts with specific text (like Freight) and return corresponding taxable or non-taxable sales values based on multiple conditions.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating conditional taxable values in a spreadsheet where shipping or freight charges must be dynamically included or excluded based on item codes.
- Observed behavior
- The user needs to combine logical operators (like equals and not-equals) with text-extraction functions to output the correct numeric values depending on whether the item is classified as freight.
Ensure your sales data is organized in columns with clear headers for item codes, tax status, and amounts. Verify that the text string you are searching for is spelled consistently across your dataset without accidental leading spaces.
Formula to Include Items Beginning with Specific Text
Use a combination of IF, AND, and LEFT functions to return a calculation only when the cell starts with specific text, such as Freight.
To check if a cell begins with a specific word, you can extract the first few characters using the LEFT function and then compare it to your target word. Combined with the IF and AND functions, you can enforce multiple conditions before returning the taxable value.
Click on the cell where you want the calculated taxable value to appear (e.g., K4).
Type the formula: =IF(AND(G4>0, F4="AZ", I4="Taxable Sales", LEFT(H4,7)="Freight"), J4, 0)
Press Enter. This formula checks if the quantity is greater than zero, the state is AZ, the status is Taxable Sales, and the first 7 letters of the item code (cell H4) equal 'Freight'. If all are true, it returns the value in J4; otherwise, it returns 0.
Click the bottom-right corner of the cell and drag the fill handle down to apply the formula to the rest of the column.

Formula to Exclude Items Beginning with Specific Text
Use the not-equal operator (<>) to calculate values for items that do not begin with your specified text.
Calculate Complex Tax Formulas Effortlessly with WPS Spreadsheet
WPS Spreadsheet provides full, seamless support for advanced logical functions like IF, AND, and text functions like LEFT. It's a highly compatible tool for managing complex sales data and conditional tax calculations without heavy resource usage.
- 1. Install WPS Office: Download and install WPS Office on your computer or mobile device.
- 2. Open your dataset: Launch WPS Spreadsheet and open your existing sales data or tax spreadsheet.
- 3. Enter your logical formula: Select the target cell, type your conditional tax formula using IF, AND, and LEFT, then press Enter to calculate.
- 4. Batch apply the formula: Drag the fill handle downwards to instantly apply your tax calculation formula across all rows in your dataset.

Frequently Asked Questions
How do I check if a cell contains text anywhere, not just at the beginning?
To find specific text anywhere within a cell, you can use the SEARCH function combined with ISNUMBER. For example, instead of using LEFT, your condition would look like: ISNUMBER(SEARCH("Freight", H4)). This will return TRUE if the word appears anywhere in the cell.
What is the not-equal operator in Excel formulas?
The not-equal operator in Excel is represented by the greater-than and less-than symbols placed together: <>. You cannot use the standard mathematical unequal symbol (≠) inside Excel formulas.
Why is my LEFT formula returning an error or failing to match?
Ensure you have specified the correct number of characters for the word you are searching. For 'Freight', you must extract exactly 7 characters using LEFT(H4,7). Additionally, check for accidental leading spaces in your raw data; if a cell has a space before 'Freight', the first 7 characters will actually be ' Freigh'.
Can I add more conditions to my AND function?
Yes, the AND function in Excel can evaluate up to 255 different logical conditions simultaneously. Just separate each logical test with a comma within the AND parentheses.




