formula help

CRAIG20

Board Regular
Joined
Mar 20, 2006
Messages
225
Hi. I have a formula for cell F7 The formula is =E7+$L$2. E7 contains a number (18). L2 also contains a number (0.5) so it adds 18+0.5 However if E7 contains a number with NIE preceding it eg. NIE15 I would like it to ignore the'NIE' and just add 0.5 to 15

Thanks in advance
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi.

Perhaps like this . . .

=IF(ISNUMBER(E7),E7,MID(E7,4,100))+$L$2

This will ignore any initial text string of exactly 3 characters at the beginning of the entry in E7, for example "NIE", "OJF", etc.

Will NOT work correctly for text strings such as "NI", or "NIEZ", where the number of alpha characters is not exactly 3.
 
Upvote 0
Thats perfect. One thing I forgot to mention is it possible to add the 'NIE' to the start of the result. eg. with your formula NIE18 changed to 18.5 But is it possible to make it NIE18.5?
 
Upvote 0
Try this . . .

=IF(ISNUMBER(E7),,LEFT(E7,3))&IF(ISNUMBER(E7),E7,MID(E7,4,100))+$L$2

This adds the first three characters from E7 to the start of the result, IF (and ONLY IF) the value in E7 is a text string, not a number.
Try it with different values.

NOTE - if E7 DOES start with "NIE", the result of this formula will be a text string, which will be more difficult to use in arithmetical formulas.
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,953
Members
449,198
Latest member
MhammadishaqKhan

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