Sumif with right and/or replace

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
I am trying to use sumif =SUMIF('Sales'!$A$1:$A$15237,'Monthly'!A1,'Sales'!$D$1:$D$15237)

The problem is that the data in Monthly A1 is text written as yyyy/mm which I cannot convert to a value unless I use something like RIGHT or REPLACE:

=RIGHT('Sales'!A1,1)+0 or

=REPLACE('Sales'!A1,1,5,"")

I don't know how to:

(a) apply either of RIGHT or REPLACE to a range of cells, and
(b) build this argument into my SUMIF.

Any advice would be appreciated.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Eg. Monthy A1= 2018/1
In B1-B6 I used the formulas below to check A1
=ISNUMBER(A1) result = #VALUE!
=DATEVALUE(A1) result = #VALUE!
=ISERROR(DATEVALUE(A1)) result = TRUE
=ISTEXT(A1) result = TRUE
=CELL("format",A1) result = G
<colgroup><col width="66" style="width: 50pt; mso-width-source: userset; mso-width-alt: 2413;"> <col width="64" style="width: 48pt;" span="3"> <tbody> </tbody>

The question does not involve 'Monthly'!A1. Rather: $A$1:$A$15237 of Sales.

What does

=ISNUMBER(Sales!$A$1)

return?
 
Upvote 0
Apologies - that was a typo - I meant Sales not Monthly. In Monthly I have eg. for Jan in A1=1 and it is a number
 
Upvote 0
Monthly A1=1
Sales A1=2018/1

ISNUMBER('Monthly'!$A$1)=TRUE
ISNUMBER('Sales'!$A$1)=#VALUE!
 
Upvote 0
You need to be careful using 1 to represent January. Your sheet can never span more than one complete calendar year or your SUMIF will be incorrect.
 
Upvote 0
Monthly A1=1
Sales A1=2018/1

ISNUMBER('Monthly'!$A$1)=TRUE
ISNUMBER('Sales'!$A$1)=#VALUE!

Is this then what we want?

[a]
=SUMIFS('Sales'!$D$1:$D$15237,'Sales'!$A$1:$A$15237,2018&"/"&'Monthly'!A1)

Or this?


=SUMIFS('Sales'!$D$1:$D$15237,'Sales'!$A$1:$A$15237,"*"&"/"&'Monthly'!A1)
 
Upvote 0

Forum statistics

Threads
1,216,115
Messages
6,128,919
Members
449,478
Latest member
Davenil

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