Any better way to do this?

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
in each cell =SUMPRODUCT(--(db!$A$2:$A26=$B$1),--(db!$F$2:$F26=C$5),--(db!$G$2:$G26=C$6),--(db!$E$2:$E26=$A7),--(db!$D$2:$D26=$B7),db!$H$2:$H26)

is suppose to return values either 1,2 or 3

if it is 1, the cell value will be KG
if it is 2, the cell value will be BAG
if it is 3, the cell value will be PKT


VLOOKUP WON't work for me because it returns >>><TABLE style="WIDTH: 73pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=97 border=0 x:str><COLGROUP><COL style="WIDTH: 73pt; mso-width-source: userset; mso-width-alt: 3547" width=97><TBODY><TR style="HEIGHT: 19.5pt; mso-height-source: userset" height=26><TD class=xl65 style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 73pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 19.5pt; BACKGROUND-COLOR: transparent" width=97 height=26 x:err="#NAME?">#NAME?</TD></TR></TBODY></TABLE>
after go to each cell then press 'enter' key then it returns
1(or 2 or 3)

Unless i got a way to refresh the page....any idea guys?
protoV5.xls
IJKL
1uomCodeUom
21KG
32PKT
41KG
53BAG
61KG
72PKT
81KG
93BAG
102PKT
113BAG
122PKT
131KG
142PKT
153BAG
162PKT
172PKT
181KG
192PKT
202PKT
213BAG
221KG
233BAG
242PKT
db
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
yup it works. Thanks!!!! :)

erm hi, can I make it return a blank "", instead of a #value?
 
Last edited:
Upvote 0

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
You're very welcome. Regarding some of your other recent posts, Peter. I see various questions and it seems the structure of the spreadsheet is leading to a complex solution. Lots of array (SUMPRODUCT) formulas. I have not looked at the details - and am not volunteering to do so - though for sure the task would be an order of magnitude easier if you can improve the set up of the data. And the reports too.

Regards, Fazza
 
Upvote 0

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
yes.....it's a headache...i'm trying to simplify it now....i'll repost it V5 of the excel once it's done...anyway regarding the #value, is there anyway to force it to display blank?
 
Upvote 0

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
Hadn't seen that new question, Peter. Thanks for mentioning it.

Why does it return #value? Input should be 1 or 2 or 3.

If not, it depends on what you are doing - there are MANY approaches.

Maybe
Code:
=IF(OR(A1={1,2,3}),CHOOSE(A1,"one","two","three"),"blank")
 
Upvote 0

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
Was trying:

=IF(CHOOSE(SUMPRODUCT(--(db!$A$2:$A57=$B$1),--(db!$F$2:$F57=E$5),--(db!$G$2:$G57=E$6),--(db!$E$2:$E57=$A7),--(db!$D$2:$D57=$B7),db!$J$2:$J57), "KG","PKT","BAG")="#VALUE!","BLANK","Not Blank")

the value is not NULL, not #VALUE!, Not 0...what on earth?
 
Upvote 0

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
Maybe best to keep it simpler. One column with the SUMPRODUCT and then the next column with the next step.

I guess you saw the formula I posted..
 
Upvote 0

Guanjin Peter

Active Member
Joined
May 21, 2008
Messages
429
I wonder how to do it...haha...Thanks for quick response
Using your formula...like this right?


=IF(OR(SUMPRODUCT(--(db!$A$2:$A57=$B$1),--(db!$F$2:$F57=C$5),--(db!$G$2:$G57=C$6),--(db!$E$2:$E57=$A7),--(db!$D$2:$D57=$B7),db!$J$2:$J57)={1,2,3}),CHOOSE(SUMPRODUCT(--(db!$A$2:$A57=$B$1),--(db!$F$2:$F57=C$5),--(db!$G$2:$G57=C$6),--(db!$E$2:$E57=$A7),--(db!$D$2:$D57=$B7),db!$J$2:$J57),"KG","PKT","BAG"),"Blank")
 
Last edited:
Upvote 0

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Was trying:

=IF(CHOOSE(SUMPRODUCT(--(db!$A$2:$A57=$B$1),--(db!$F$2:$F57=E$5),--(db!$G$2:$G57=E$6),--(db!$E$2:$E57=$A7),--(db!$D$2:$D57=$B7),db!$J$2:$J57), "KG","PKT","BAG")="#VALUE!","BLANK","Not Blank")

the value is not NULL, not #VALUE!, Not 0...what on earth?

=CHOOSE(SUMPRODUCT(...)+1,"","KG","PKT","BAG")

"" is a blank, which you can replace with "BLANK" if so desired.
 
Upvote 0

Forum statistics

Threads
1,190,790
Messages
5,982,936
Members
439,808
Latest member
agutosay

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