Wrong Data Type error

highflight1985

New Member
Joined
Jun 8, 2011
Messages
20
I have two date values which did the following to calculate the time difference between them:

=IF(AND(A4<>0,B4<>0,C4<>0,D4<>0),SUM(K4/(((C4+D4)-(A4+B4))*24)),"")

where C4 is a date, D4 is a time; same for A4 and B4 respectively.

How do I take the result of that and use it in another formula on another sheet by referencing the cell? When I do, I get "VALUE" error, saying it's of the wrong data type...
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
The formula causing the error is:

=SUM(('Load Entry'!$C$4:$C$563<=$A$28)*('Load Entry'!$C$4:$C$563>=$A$27)*'Load Entry'!$Y$4:$Y$563)

Where Y is the referenced cell I was talking about...
 
Upvote 0
I have two date values which did the following to calculate the time difference between them:

=IF(AND(A4<>0,B4<>0,C4<>0,D4<>0),SUM(K4/(((C4+D4)-(A4+B4))*24)),"")

where C4 is a date, D4 is a time; same for A4 and B4 respectively.

How do I take the result of that and use it in another formula on another sheet by referencing the cell? When I do, I get "VALUE" error, saying it's of the wrong data type...
It depends on how you're using the result of that formula.

You're probably getting the error when the above formula returns the formula blank "" which is a TEXT string.

You may need to first test the result of the above formula to see if it's a number. For example, if that formula is entered in cell A1...

=IF(COUNT(A1),your_other_formula_here,"")
 
Upvote 0
The formula causing the error is:

=SUM(('Load Entry'!$C$4:$C$563<=$A$28)*('Load Entry'!$C$4:$C$563>=$A$27)*'Load Entry'!$Y$4:$Y$563)

Where Y is the referenced cell I was talking about...
Don't use the SUM syntax. Use the SUMPRODUCT version we showed you in the other thread.

=SUMPRODUCT(--('Load Entry'!$C$4:$C$563>=$A$27),--('Load Entry'!$C$4:$C$563<=$A$28),'Load Entry'!$Y$4:$Y$563)

When using that syntax, it'll ignore TEXT entries in the sum range 'Load Entry'!$Y$4:$Y$563.
 
Upvote 0

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

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