Formatting Cells to Ignore Text Within a Cell

BBA18

New Member
Joined
Dec 27, 2016
Messages
11
How can I get Excel to ignore text in a cell that I am referencing?

For example, how would I get cell A3 to return a value of 200 by using the formula "A1*A2"?

A1: 2 Bagels
A2: 100
A3: ??

To take it one step further, how would I get cell A3 to return a value of 35 by using the formula "A1*A2"

A1: $10 less $5 that I lost on the bus
A2: 7
A3: ???
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You need to exploit regularities in the data.

For the first condition:

=--LEFT(A1,FIND(" ",A1)-1)*A2

...which assumes that numbers turn up before the first space in the string.

For the second condition, is the following true:

the text string will always have two $ amounts (preceded by a $ and followed by a space); find them and subtract the second from the first.

...because formula that copes with that won't cope with other structures...

In any case, it is better to avoid all these formula gymnastics by keeping text and numbers separate.
 
Upvote 0
You need to exploit regularities in the data.

For the first condition:

=--LEFT(A1,FIND(" ",A1)-1)*A2

...which assumes that numbers turn up before the first space in the string.

For the second condition, is the following true:

the text string will always have two $ amounts (preceded by a $ and followed by a space); find them and subtract the second from the first.

...because formula that copes with that won't cope with other structures...

In any case, it is better to avoid all these formula gymnastics by keeping text and numbers separate.

I'm not trying to have the text ignored in the cell when I reference it for a formula per se.

I would like cell A1 to show "2 Bagels" on the workbook sheet, but when I select cell A1 I would like to see "2" in the formula bar.
 
Upvote 0
Try a custom format.

just enter 2 in the cell, and use Custom Formatting # "bagels"
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top