Need help with this extensive formula

grev

New Member
Joined
Sep 4, 2002
Messages
21
The result for this is either a zero or a numerical value > 1. I am trying to replace the zero with a blank. However when I do calculations it gives me an error. How can I use this and turn the blank into a calculable result. Thanks for the help.

=IF(COUNTIF('TRKLD SCHED'!$V$1:$BC$1,A13),HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),"0")+IF(COUNTIF('TRKLD SCHED'!$D$1:$N$1,A13),HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),"0")
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
On 2002-09-20 12:58, grev wrote:
The result for this is either a zero or a numerical value > 1. I am trying to replace the zero with a blank. However when I do calculations it gives me an error. How can I use this and turn the blank into a calculable result. Thanks for the help.

=IF(COUNTIF('TRKLD SCHED'!$V$1:$BC$1,A13),HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),"0")+IF(COUNTIF('TRKLD SCHED'!$D$1:$N$1,A13),HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),"0")

May I suggest that you install the add-in morefunc.xll, downloadable from:

http://longre.free.fr/english/index.html

and use the following formula instead:


=IF(ISNA(SETV(HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0))),0,GETV())+IF(ISNA(SETV(HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0))),0,GETV())

You have "0" in the original formula: that should be just 0 without double quotes.
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,562
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
On 2002-09-20 12:58, grev wrote:
The result for this is either a zero or a numerical value > 1. I am trying to replace the zero with a blank. However when I do calculations it gives me an error. How can I use this and turn the blank into a calculable result. Thanks for the help.

=IF(COUNTIF('TRKLD SCHED'!$V$1:$BC$1,A13),HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),"0")+IF(COUNTIF('TRKLD SCHED'!$D$1:$N$1,A13),HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),"0")


This edits YOUR formula to leave a blank

=IF(COUNTIF('TRKLD SCHED'!$V$1:$BC$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),"")&IF(COUNTIF('TRKLD SCHED'!$D$1:$N$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),"")
This message was edited by dave patton on 2002-09-20 13:26
 

grev

New Member
Joined
Sep 4, 2002
Messages
21
Im sorry i forgot to mention I currently have left the zero's because they calculate. If I replace the zeros with blanks that is when the problem occurs.

I am using this formula to lookup values from other tables and retreive their respective values.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201

ADVERTISEMENT

On 2002-09-20 13:27, grev wrote:
Im sorry i forgot to mention I currently have left the zero's because they calculate. If I replace the zeros with blanks that is when the problem occurs.

I am using this formula to lookup values from other tables and retreive their respective values.

If you need to replace 0's (without double quotes around), although I don't see why, you can use SUM instead of +...

=SUM(IF(...),IF(...))

Try using morefunc though.
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,562
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
You stated at the beginning that you wanted to replace the 0 with a blank.

Wrap the formula with an If. The following uses MoreFunc.

Either Aladin's
=IF(SETV(IF(ISNA(SETV(HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),0)),0,GETV())+IF(ISNA(SETV(HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),1)),0,GETV(1)),2),GETV(2),"")

or
=IF(SETV(IF(COUNTIF('TRKLD SCHED'!$V$1:$BC$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),0)+IF(COUNTIF('TRKLD SCHED'!$D$1:$N$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),0),2),GETV(2),"")
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201

ADVERTISEMENT

[...]
=IF(SETV(IF(COUNTIF('TRKLD SCHED'!$V$1:$BC$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),0)+IF(COUNTIF('TRKLD SCHED'!$D$1:$N$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),0),2),GETV(2),"")

Dave,

Keeping COUNTIF in defeats the purpose of SETV/GETV.

Aladin
 

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,562
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
On 2002-09-20 14:10, Aladin Akyurek wrote:
[...]
=IF(SETV(IF(COUNTIF('TRKLD SCHED'!$V$1:$BC$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$V$1:$BC$113,107,0),0)+IF(COUNTIF('TRKLD SCHED'!$D$1:$N$1,A13)>0,HLOOKUP(A13,'TRKLD SCHED'!$D$1:$N$113,107,0),0),2),GETV(2),"")

Dave,

Keeping COUNTIF in defeats the purpose of SETV/GETV.

Aladin

I know. I was just trying to complete OP's original question of showing number >0 or blank.

I showed the diferent solutions but instead of wrapping everything with IF and repeating the formula, I used the more efficient Setv and Getv combo.
 

grev

New Member
Joined
Sep 4, 2002
Messages
21
Thanks guys. It worked. I will disect it to see how it works. Thanks.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,371
Messages
5,595,784
Members
414,020
Latest member
Meghdad

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