Formula woes...

tlynn

Board Regular
Joined
Aug 28, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
=IF(C12="","",IF(C12<>C10,IF(LEFT(C12,2)=47,47,"")))

I know that the "LEFT" function is text based, but it was a last ditch effort to get this to work.

Basically it starts by checking to see if c12 is filled or not...works fine. Then it goes on to see if c12 is different from c10 and if it is, is it filled with a 5 digit number starting with 47? If it is then the cell that this formula is nested in will, rather, should put a 47 in it and if there is not then the cell should remain blank or empty.

Any suggestions?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
Hi

Have you tried

IF(C12="","",IF(C12<>C10,IF(And(Len(C12)=5,LEFT(C12,2)="47"),47,"")))

Left function returns string type result.
 
Upvote 0

debooo

Board Regular
Joined
Nov 2, 2006
Messages
86
so if c10 said 47555 and c12 said 47111 the formula should return 47

but if either c10 and c12 is blank, or if either start with something other then 47, or if they are identical numbers the formula should reutn a blank?
 
Upvote 0

tlynn

Board Regular
Joined
Aug 28, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
Jindon, no dice...if c10 and c12 are the same I get "FALSE"..if they are the same it should basically make the cell empty.

I think you are correct Debooo...

if c10 and c12 are the same the cell this formula is nested in should be blank. If c12 is different it should basically pop up a 47 in the cell.
 
Upvote 0

tlynn

Board Regular
Joined
Aug 28, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
Maybe I am making this formula too difficult. If that is the case, any suggestion on a different way to do it would be appreciated...
 
Upvote 0

Yogi Anand

MrExcel MVP
Joined
Mar 12, 2002
Messages
11,454
=IF(C12="","",IF(C12<>C10,IF(LEFT(C12,2)=47,47,"")))

I know that the "LEFT" function is text based, but it was a last ditch effort to get this to work.

Basically it starts by checking to see if c12 is filled or not...works fine. Then it goes on to see if c12 is different from c10 and if it is, is it filled with a 5 digit number starting with 47? If it is then the cell that this formula is nested in will, rather, should put a 47 in it and if there is not then the cell should remain blank or empty.

Any suggestions?

Hi tlynn:

How about ...
Code:
=IF(C12="","",IF(C12<>C10,IF(LEFT(C12,2)="47",47,"")))
Does this work for you now?
 
Upvote 0

debooo

Board Regular
Joined
Nov 2, 2006
Messages
86
=IF(C12="","",IF(C12<>C10,IF(AND(LEN(C12)=5,LEFT(C12,2)="47"),47," ")," "))

i barely tweeked the formula above, is this what you wanted?
 
Upvote 0

tlynn

Board Regular
Joined
Aug 28, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
Again no dice...funny thing is that was one of the original ways I tried it. when C10 and c12 are the same I get a false statement...if both cells are the same the cell should remain blank. Any other suggestions?
 
Upvote 0

tlynn

Board Regular
Joined
Aug 28, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
Debooo you are a rock star! Perfect! Thank you all for your help on this one.
 
Upvote 0

Forum statistics

Threads
1,191,274
Messages
5,985,698
Members
439,974
Latest member
sjoerdbosch

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
Top