A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If logic problem



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2004, 11:53 PM
Jeff Smith
external usenet poster
 
Posts: n/a
Default If logic problem

Hi,

There has been an amendment to a National Standard that has created a
problem for me.

Products are in the (strength) range 17.5,20,25,30,35 etc up to 70
I have isolated the unique problem with the 17 being 17.5 and dealt with it.

My problem is sometimes the values I am extracting are in the 1st and 2nd
postion e.g:

=IF(Create!D6="","",IF(LEFT(Create!D6,2)="17",17.5 ,VALUE(LEFT(CreateMix!D6,2
))))

BUT now, some of the values I need to extract are in the 2nd and 3rd
position e.g. In this situatiuon the first character is always a letter
followed by the two numbers I need to extact.

=IF(Create!D6="","",IF(LEFT(CreateMix!D6,2)="17",1 7.5,VALUE(MID(Create!D6,2,
2))))

I have tried all kinds of new formulas to no avail. In english I need to
say:

If the cell in Create! D6 is empty, do nothing.
If the contents of Create!D6 is (say) 20xxxxxxxxx take the value "20" from
the first two characters.
If the contents of Create!D6 is (say) P20xxxxxxxxxx take the value "20" from
the 2nd and 3rd characters.

I hope I have described my problem clearly. Any assistance would be greatly
appreciated.

Thanking you in anticipation,

Jeff Smith




  #2  
Old May 12th, 2004, 11:57 PM
Dave R.
external usenet poster
 
Posts: n/a
Default If logic problem

try

=IF(ISERROR(--LEFT(A1,1)),--MID(A1,2,2),--LEFT(A1,2))

... with your stuff wrapped around it

:|




"Jeff Smith" wrote in message
...
Hi,

There has been an amendment to a National Standard that has created a
problem for me.

Products are in the (strength) range 17.5,20,25,30,35 etc up to 70
I have isolated the unique problem with the 17 being 17.5 and dealt with

it.

My problem is sometimes the values I am extracting are in the 1st and 2nd
postion e.g:


=IF(Create!D6="","",IF(LEFT(Create!D6,2)="17",17.5 ,VALUE(LEFT(CreateMix!D6,2
))))

BUT now, some of the values I need to extract are in the 2nd and 3rd
position e.g. In this situatiuon the first character is always a letter
followed by the two numbers I need to extact.


=IF(Create!D6="","",IF(LEFT(CreateMix!D6,2)="17",1 7.5,VALUE(MID(Create!D6,2,
2))))

I have tried all kinds of new formulas to no avail. In english I need to
say:

If the cell in Create! D6 is empty, do nothing.
If the contents of Create!D6 is (say) 20xxxxxxxxx take the value "20" from
the first two characters.
If the contents of Create!D6 is (say) P20xxxxxxxxxx take the value "20"

from
the 2nd and 3rd characters.

I hope I have described my problem clearly. Any assistance would be

greatly
appreciated.

Thanking you in anticipation,

Jeff Smith






  #3  
Old May 13th, 2004, 12:23 AM
Harlan Grove
external usenet poster
 
Posts: n/a
Default If logic problem

"Jeff Smith" wrote...
...
I have tried all kinds of new formulas to no avail. In english I need to
say:

If the cell in Create! D6 is empty, do nothing.
If the contents of Create!D6 is (say) 20xxxxxxxxx take the value "20" from
the first two characters.
If the contents of Create!D6 is (say) P20xxxxxxxxxx take the value "20" from
the 2nd and 3rd characters.

...

=IF(ISNUMBER(-LEFT(Create!D6,2)),LEFT(Create!D6,2)+(LEFT(Create! D6,2)="17")/2,
IF(ISNUMBER(-MID(Create!D6,2,2)),MID(Create!D6,2,2)+(MID(Create !D6,2,2)="17")/2,
IF(Create!D6="","","UNEXPECTED")))

--
To top-post is human, to bottom-post and snip is sublime.
  #4  
Old May 13th, 2004, 12:24 AM
Jeff Smith
external usenet poster
 
Posts: n/a
Default If logic problem

Thanks for the quick reply Dave. I don't understand about wrapping my stuff
around it :- (

I tried inserting your suggested solution in several places but to no avail.
Would I be asking too much for you to copy/past my if statement and insert
your suggested ISERROR code so I can better understand.

(I do have a glimmer of an understanding about your solution. There is the
makings of me learning something really new so I can use this technique in
other appplications). I do appreciate you taking the time to help me.

sincerely

Jeff Smith




"Dave R." wrote in message
...
try

=IF(ISERROR(--LEFT(A1,1)),--MID(A1,2,2),--LEFT(A1,2))

.. with your stuff wrapped around it

:|




"Jeff Smith" wrote in message
...
Hi,

There has been an amendment to a National Standard that has created a
problem for me.

Products are in the (strength) range 17.5,20,25,30,35 etc up to 70
I have isolated the unique problem with the 17 being 17.5 and dealt with

it.

My problem is sometimes the values I am extracting are in the 1st and

2nd
postion e.g:



=IF(Create!D6="","",IF(LEFT(Create!D6,2)="17",17.5 ,VALUE(LEFT(CreateMix!D6,2
))))

BUT now, some of the values I need to extract are in the 2nd and 3rd
position e.g. In this situatiuon the first character is always a letter
followed by the two numbers I need to extact.



=IF(Create!D6="","",IF(LEFT(CreateMix!D6,2)="17",1 7.5,VALUE(MID(Create!D6,2,
2))))

I have tried all kinds of new formulas to no avail. In english I need

to
say:

If the cell in Create! D6 is empty, do nothing.
If the contents of Create!D6 is (say) 20xxxxxxxxx take the value "20"

from
the first two characters.
If the contents of Create!D6 is (say) P20xxxxxxxxxx take the value "20"

from
the 2nd and 3rd characters.

I hope I have described my problem clearly. Any assistance would be

greatly
appreciated.

Thanking you in anticipation,

Jeff Smith








  #5  
Old May 13th, 2004, 12:48 AM
Jeff Smith
external usenet poster
 
Posts: n/a
Default If logic problem

Harlan,

This works well. I'm going to have to do some further reading in Excel as I
don't know why this works ... but I'm learning.

Thnaks for taking the time to help. It is appreciated.

sincerely

Jeff Smith




"Harlan Grove" wrote in message
...
"Jeff Smith" wrote...
..
I have tried all kinds of new formulas to no avail. In english I need to
say:

If the cell in Create! D6 is empty, do nothing.
If the contents of Create!D6 is (say) 20xxxxxxxxx take the value "20"

from
the first two characters.
If the contents of Create!D6 is (say) P20xxxxxxxxxx take the value "20"

from
the 2nd and 3rd characters.

..


=IF(ISNUMBER(-LEFT(Create!D6,2)),LEFT(Create!D6,2)+(LEFT(Create! D6,2)="17")/
2,

IF(ISNUMBER(-MID(Create!D6,2,2)),MID(Create!D6,2,2)+(MID(Create !D6,2,2)="17"
)/2,
IF(Create!D6="","","UNEXPECTED")))

--
To top-post is human, to bottom-post and snip is sublime.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.